TextToHtml(text) Last updated: 21. Dec 2022

Converts input text to HTML (line breaks and encoding chars).

Parameters

Name Type Description
text string Text to convert to HTML.

Returns

String with encoded chars and line breaks replaced with <br> tags.

Example

Code example (#JS)

#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.
#{
    var text = "Hello" + chr(13) + "world!";
    var html = docly.textToHtml(text);
    write(html)
}#

Output

The #JS code above produces the output shown below:
Hello
world!