MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / unescape

Function unescape

tools/python-3.11.9-amd64/Lib/html/__init__.py:122–132  ·  view source on GitHub ↗

Convert all named and numeric character references (e.g. >, >, &x3e;) in the string s to the corresponding unicode characters. This function uses the rules defined by the HTML 5 standard for both valid and invalid character references, and the list of HTML 5 named ch

(s)

Source from the content-addressed store, hash-verified

120 r'|[^\t\n\f <&#;]{1,32};?)')
121
122def unescape(s):
123 """
124 Convert all named and numeric character references (e.g. &gt;, &#62;,
125 &x3e;) in the string s to the corresponding unicode characters.
126 This function uses the rules defined by the HTML 5 standard
127 for both valid and invalid character references, and the list of
128 HTML 5 named character references defined in html.entities.html5.
129 """
130 if '&' not in s:
131 return s
132 return _charref.sub(_replace_charref, s)

Callers 3

goaheadMethod · 0.90
parse_starttagMethod · 0.90
linksMethod · 0.50

Calls 1

subMethod · 0.45

Tested by

no test coverage detected