HTML.format(html) Last updated: 27. Aug 2024

Returns specified HTML string formatted as "prettified" indented HTML.

Parameters

Name Type Description
html string HTML code to format.

Returns

Formatted HTML string.

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>