HTML.format(html) Last updated: 31. Dec 2022

Outputs specified html string to "prettified" indented html.

Parameters

Name Type Description
html string Html code to format.

Returns

Nothing, but writes text to output stream.

Example

Code example (#JS)

#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.
#{
    var html = "<div><a href=\"#\">Test</a></div>";
    html = HTML.format(html);
    
    // Remove empty lines for demo output
    html = html.replace(chr(13), "");
    
    write(html);
}#

Output

The #JS code above produces the output shown below:
<div>
	<a href="#">
		Test
	</a>
</div>