Beautify

Component ID

355057

Component name

Beautify

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

5510

Component created

Component changed

Component body

This module is looking for a co-maintainer. Please contact psynaptic via his personal contact form if you are interested.

The Beautify module buffers the HTML output of Drupal and processes it through HTML Tidy, htmLawed or a set of built-in search/replace functions for beautifying (auto-indentation), flattening (removing indentations) and compacting the HTML source output to the browser.

Page caching has been utilised so there should be no significant performance penalty, unless of course the chosen processing method increases the HTML file size (e.g. when using beautification over flattening or compacting). In general the flattening mode would provide a nice middle ground between performance improvement and code beautification. Not all options are available from all methods.

The module currently works best with with HTML Tidy and htmLawed.

The module is limited to only serve processed output to anonymous users. It can also cause problems with textarea input fields as it may strip newlines from the input.

HTML Tidy

Beautify will search for an HTML Tidy binary and if found, it will be tested and used for processing. The module currently supports only the binary version of HTML Tidy and not the PECL extension found in some PHP installations.

HTML Tidy works well and has some specific options. You may find htmLawed produces a more beautiful looking output.

htmLawed

The htmLawed.php file is included in the package and seems to work pretty well. It produces more beautiful output than HTML Tidy and is the recommended processor for when beautiful HTML output is top priority.

Built-in

The module also contains 2 processing functions for modifying the HTML output to the browser. There is a flattening function which removes all indentation and a compacting function which removes all newlines and replaces them with a space. The compacting function doesn't reduce the file size but could be useful in certain circumstances.

The Beautify module will remain in development status until it has been tested further and the page caching has been confirmed to work well.

This module is not ready for production. Currently only the htmLawed mode works well.

This module was sponsored and is maintained by Freestyle Systems.