This commit is contained in:
Miroslav Stampar
2016-05-15 09:37:45 +02:00
parent cc9f4b6102
commit 94091cd0e9
2 changed files with 2 additions and 2 deletions

View File

@@ -160,7 +160,7 @@ def htmlunescape(value):
codes = (('&lt;', '<'), ('&gt;', '>'), ('&quot;', '"'), ('&nbsp;', ' '), ('&amp;', '&'))
retVal = reduce(lambda x, y: x.replace(y[0], y[1]), codes, retVal)
try:
retVal = re.sub(r"&#x([^;]+);", lambda match: unichr(int(match.group(1), 16)), retVal)
retVal = re.sub(r"&#x([^ ;]+);", lambda match: unichr(int(match.group(1), 16)), retVal)
except ValueError:
pass
return retVal