You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In SGML, HTML and XML documents, the logical constructs known as character data and attribute values consist of sequences of characters, in which each character can manifest directly (representing itself), or can be represented by a series of characters called a character reference, of which there are two types: a numeric character reference (&#nnnn; or &#xhhhh;) and a character entity reference (&name;).
It's relatively easy to unescape those numeric HTML entities, you only need to pass character code into String.fromCharCode() method to unescape into its raw character.
Comprehensively unescaping HTML entities
In order to comprehensively unescaping HTML entities, including numeric and named characters; We need to leverage other solutions beyond the String.fromCharCode method.
Unescaping HTML entities
Understanding HTML entity
The definition of character entity from Wikipedia:
In SGML, HTML and XML documents, the logical constructs known as character data and attribute values consist of sequences of characters, in which each character can manifest directly (representing itself), or can be represented by a series of characters called a character reference, of which there are two types: a numeric character reference (
&#nnnn;
or&#xhhhh;
) and a character entity reference (&name;
).Lists of HTML entities
Related tools
he
package.Potential unescaping solutions
Unescaping numeric HTML entities
It's relatively easy to unescape those numeric HTML entities, you only need to pass character code into
String.fromCharCode()
method to unescape into its raw character.Comprehensively unescaping HTML entities
In order to comprehensively unescaping HTML entities, including numeric and named characters; We need to leverage other solutions beyond the
String.fromCharCode
method..innerHTML
The
he
packageThe text was updated successfully, but these errors were encountered: