dojox/html/format (version 1.10)

See the dojox/html/format reference documentation for more information.

Method Summary

  • prettyPrint(html,indentBy,maxLineLength,map,xhtml) Function for providing a 'pretty print' version of HTML content from the provided string.

Methods

prettyPrint(html,indentBy,maxLineLength,map,xhtml)
Defined by dojox/html/format

Function for providing a 'pretty print' version of HTML content from the provided string. It's nor perfect by any means, but it does a 'reasonable job'.

Parameter Type Description
html String

The string of HTML to try and generate a 'pretty' formatting.

indentBy Integer

Optional input for the number of spaces to use when indenting. If not defined, zero, negative, or greater than 10, will just use tab as the indent.

maxLineLength Integer

Optional input for the number of characters a text line should use in the document, including the indent if possible.

map Array

Optional array of entity mapping characters to use when processing the HTML Text content. By default it uses the default set used by the dojox.html.entities.encode function.

xhtml boolean

Optional parameter that declares that the returned HTML should try to be 'xhtml' compatible. This means normally unclosed tags are terminated with /> instead of >. Example: <hr> -> <hr />

Error in the documentation? Can’t find what you are looking for? Let us know!