Skip To Content

INTEGRAL

INTEGRAL DSL Reference Guide

Jump directly to: 

::my.app.ToHTML(string, flags = 0)

This function takes an input string and returns a new string in which certain characters are converted to HTML entities or HTML tags. Specifically:

Parameters

string

A string to be converted to HTML.

flags

A bitmask that tells the function what additional HTML conversions to perform, if any.

Return Value

The function returns a new string in which certain characters are converted to HTML entities or HTML tags as noted above.

Note 1

Certain characters have special significance in HTML and should be converted to HTML entities if they are to preserve their meaning. This function returns a string with these conversions made.

Example 1

local intro = ::my.app.ToHTML("John & Jill went to see \"Start Wars\" last weekend");
::my.app.Print(intro);

Result:

John & Jill went to see "Start Wars" last weekend.

Example 2

local my_list = ::my.app.ToHTML("John & Jill\nMark & Susan\nTom & Mary", 1);
::my.app.Print(my_list);

Result:

John &amp; Jill<br />Mark &amp; Susan<br />Tom &amp; Mary