Quantcast
Channel: How can I automatically clean, beautify, and autoindent dynamic HTML code? - Webmasters Stack Exchange
Viewing all articles
Browse latest Browse all 2

How can I automatically clean, beautify, and autoindent dynamic HTML code?

$
0
0

Using content management systems to build dynamic sites invariably results in ugly HTML. Indent levels are often wrong, white space litters the page, and a host of other tiny annoyances plague anyone attempting to read the source code for debugging or educational purposes.

Is there a way to automatically strip white space, autoindent, and otherwise beautify the output of a PHP or other dynamic script that spits out HTML?

I'm interested in any automated server-side solution that will improve the legibility of dynamically generated HTML, as well as solutions that strip all white space for compression purposes. If it matters, I normally run Apache or nginx.

It's safe to assume that I'm caching the output, so I won't be running whatever HTML beautification witchcraft you suggest on every page view (and taking the associated performance hit each time). As such, I'm more interested in ease of setup and reliable results than I am in performance.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images