See the dojox/html/format reference documentation for more information.
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: |