Show More
@@ -168,7 +168,13 b' def render_tokenstream(tokenstream):' | |||||
168 | if op_tag: |
|
168 | if op_tag: | |
169 | result.append(u'<%s>' % op_tag) |
|
169 | result.append(u'<%s>' % op_tag) | |
170 |
|
170 | |||
171 | escaped_text = html_escape(token_text) |
|
171 | # NOTE(marcink): in some cases of mixed encodings, we might run into | |
|
172 | # troubles in the html_escape, in this case we say unicode force on token_text | |||
|
173 | # that would ensure "correct" data even with the cost of rendered | |||
|
174 | try: | |||
|
175 | escaped_text = html_escape(token_text) | |||
|
176 | except TypeError: | |||
|
177 | escaped_text = html_escape(safe_unicode(token_text)) | |||
172 |
|
178 | |||
173 | # TODO: dan: investigate showing hidden characters like space/nl/tab |
|
179 | # TODO: dan: investigate showing hidden characters like space/nl/tab | |
174 | # escaped_text = escaped_text.replace(' ', '<sp> </sp>') |
|
180 | # escaped_text = escaped_text.replace(' ', '<sp> </sp>') |
General Comments 0
You need to be logged in to leave comments.
Login now