toHtml(text, [text2], [...]) Last updated: 30. May 2026

Converts multi line plain text to HTML.

Parameters

Name Type Description
text string

Text to convert

text2 (optional) string

Multiple texts may be passed.

... (optional) string

Additional texts to convert.

Returns

A converted string.

Example

Code example (#JS)

#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.
Convert to link:
#docly.toHtml("www.docly.net")#


Convert multiple lines to br tags:
#{
    write(docly.toHtml(`Line one
        Line two
        Line three`)); 
}#

Output

The #JS code above produces the output shown below:
Convert to link:
<a href="http://www.docly.net" title="Click to open in a new window or tab" target="&#95;blank">www.docly.net</a>

Convert multiple lines to br tags:
Line one<br />        Line two<br />        Line three