WebMake
WebMake Documentation (version 2.4)

The HTML Cleaner

The HTML cleaner is a powerful filter which can polish grotty, messy HTML into fully-standards-compliant glory. By default, all output of format text/html (the default format) will be passed through it.

It is controlled using the clean parameter of the <out> tag. The features to be used should be listed in this parameter's value, separated by whitespace.

Here are the features available:

  • pack - Compress the HTML, removing all white space that is not part of an attribute's value, or inside <xmp> or <pre> tags.
  • indent - "Pretty-print" the HTML, indenting tags appropriately, except for text and markup inside <xmp> or <pre> tags.
  • nocomments - Trim all comments.
  • addimgsizes - Add image sizes to <img> tags if they do not already specify them.
  • cleanattrs - Quote all attributes in opening tags, and lowercase all tag names.
  • addxmlslashes - Add XML-style slashes to the end of empty-element tags, such as <hr>, <img> etc.
  • fixcolors - Fix colors that do not start with a # character, so that they do.

The feature string all can be used to include all cleaning modes.

The default mode is pack addimgsizes cleanattrs addxmlslashes fixcolors indent.

WebMake Documentation (version 2.4)
Built With WebMake