unescapeHTML(text: String);
text. Text to be unescaped.
The unescapeHTML method unescapes characters of HTML markup in the specified string.
This method returns a String-type value.
For escaping control characters, use the PP.escapeHTML method.
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: <div class="mark">12</div>
Unescape string: <div class="mark">12</div>
See also: