PP.unescapeHTML

Syntax

unescapeHTML(text: String);

Parameters

text. Text to be unescaped.

Description

The unescapeHTML method unescapes characters of HTML markup in the specified string.

Comments

This method returns a String-type value.

For escaping control characters, use the PP.escapeHTML method.

Example

To execute the example, add a link to PP.js scenario file to HTML page. Determine a string that contains control characters, escape this string, and then unescape it back:

// Determine source string with control characters
var sourceStr = "<div class=\"mark\">12</div>"
console.log("Source string: " + sourceStr);
// Escape characters
var escapeStr = PP.escapeHTML(sourceStr);
console.log("Escaped string: " + escapeStr);
// Unescape characters
console.log("Unescaped string: " + PP.unescapeHTML(escapeStr));

After executing the example the browser console displays the source string containing control characters, next escaped and unescaped versions of this string are shown:

Source string: <div class="mark">12</div>
Escape string: &lt;div class="mark"&gt;12&lt;/div&gt;
Unescape string: <div class="mark">12</div>

See also:

PP