Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

unescapeHTML(subjectString) ⇒ String

Converts the HTML entities &, <, >, ", &#34 and ' in a string to their corresponding characters.

Returns: String - The unescaped string.
Throws:

  • TypeError If subjectString is not string.
Param Type Description
subjectString String The HTML string to unescape.

Example

unescapeHTML('<script src="main.js"></script>');
// => '<script src="main.js"></script>'

unescapeHTML('Hello &amp; &lt;span&gt;World&lt;/span&gt;');
// => 'Hello & <span>World</span>'

unescapeHTML('&lt;p data-id=&quot;1&quot;&gt;lorem ipsum&lt;/p&gt;');
// => '<p data-id="1">lorem ipsum</p>'