6

More often than not when using things like CMS'es and static site generators, HTML output looks like rubbish (wrong indendation being the most annoying flaw).

Is there any solution for having rendered output in Chrome's "View Source" tidied / prettified?

In my case I'm using a static site generator. Everything looks perfect in the editor but code gets screwed when previewing in the browser.

(I know I can probably add a build task (e.g. Grunt) to handle HTML-prettifying. But in many cases, such as when using live-reload tools (I'm using Mixture.io) where you actually preview an internal version of the site, that's not an optimal solution.)

Henrik
  • 595

2 Answers2

8

I recommend Quick Source Viewer.
It can show you the source of the current page formatted and colour coded.

It's pretty powerful, showing all 'sources' of the page, be it css, js or html. Even things like inline css/js can be viewed individually (with injected code highlighted). And the best part is it prettifies all of them, even the css (which chrome's dev tools still refuses to do).

Hashbrown
  • 3,338
  • 4
  • 39
  • 51
0

I usually just Ctrl+Shift+I for Inspect. The Elements tab has all the html, with clor coding and hide-unhide for sections.

jon
  • 1