Shall space (
) be replaced with
.
Shall line break (\n
) be replaced with <br>
.
ix.util.htmlEncode('<a href="https://foobar?rq_foo=bar&rq_bar=foo">encode me </a>');
// returns: "<a href="https://foobar?rq_foo=bar&rq_bar=foo">encode me </a>"
ix.util.htmlEncode("<h1>example</h1>\n<p>my cool paragraph</p>", true, true);
// returns: "<h1>example</h1><br><p>my cool paragraph</p>"
Ecapes a string and converts traces of HTML characters that could be wrongfully interpreted as markup. The following characters are reserved in HTML and must be replaced with their corresponding HTML entities:
"
is replaced with"
&
is replaced with&
<
is replaced with<
>
is replaced with>