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)
| 120 | r'|[^\t\n\f <&#;]{1,32};?)') |
| 121 | |
| 122 | def unescape(s): |
| 123 | """ |
| 124 | Convert all named and numeric character references (e.g. >, >, |
| 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) |
no test coverage detected