10BC0
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c12357b commit 6b42a4cCopy full SHA for 6b42a4c
html5lib/serializer/htmlserializer.py
@@ -27,7 +27,11 @@
27
for k, v in entities.items():
28
if v != "&" and encode_entity_map.get(v) != k.lower():
29
# prefer < over < and similarly for &, >, etc.
30
- encode_entity_map[ord(v)] = k
+ if len(v) == 2:
31
+ v = utils.surrogatePairToCodepoint(v)
32
+ else:
33
+ v = ord(v)
34
+ encode_entity_map[v] = k
35
36
def htmlentityreplace_errors(exc):
37
if isinstance(exc, (UnicodeEncodeError, UnicodeTranslateError)):
0 commit comments