File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ def __init__(self, **kwargs):
167167 def encode (self , string ):
168168 assert (isinstance (string , text_type ))
169169 if self .escape_invisible :
170- text = utils .escapeInvisible (text , self .escape_invisible == 'named' )
170+ string = utils .escapeInvisible (string , self .escape_invisible == 'named' )
171171 if self .encoding :
172172 return string .encode (self .encoding , unicode_encode_errors )
173173 else :
Original file line number Diff line number Diff line change 22
33from types import ModuleType
44
5+ from six import text_type
6+
57from .constants import invisibleChars
68
79
@@ -87,11 +89,11 @@ def escapeInvisible(text, useNamedEntities=False):
8789 if ord (c ) in invisibleChars :
8890 escapable .add (c )
8991 if useNamedEntities :
92+ # for c in escapable:
93+ # name = codepoint2name.get(ord(c))
94+ # escape = "&%s;" % name if name else "&#x%X;" % ord(c)
95+ # text = text.replace(c, escape)
9096 raise NotImplementedError ("This doesn't work on Python 3" )
91- for c in escapable :
92- name = codepoint2name .get (ord (c ))
93- escape = "&%s;" % name if name else "&#x%X;" % ord (c )
94- text = text .replace (c , escape )
9597 else :
9698 for c in escapable :
9799 text = text .replace (c , "&#x%X;" % ord (c ))
You can’t perform that action at this time.
0 commit comments