diff options
author | Martin Vilcans <martin@librador.com> | 2011-12-10 01:31:29 +0100 |
---|---|---|
committer | Martin Vilcans <martin@librador.com> | 2011-12-10 01:31:29 +0100 |
commit | 276ca0b6c5e29a54aa0539a34e0e691b5985454e (patch) | |
tree | cda8749b8a8d19cd9e6d3d6cb4eba8679f2c74e1 | |
parent | 98d3e6a81a4fa49a57a448b06bf6a75d676a547d (diff) | |
download | screenplain-276ca0b6c5e29a54aa0539a34e0e691b5985454e.tar.gz |
Use HTML character references for special characters.
E.g. write "é"; instead of "é".
-rw-r--r-- | screenplain/richstring.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/screenplain/richstring.py b/screenplain/richstring.py index 31dfa53..92b9bdd 100644 --- a/screenplain/richstring.py +++ b/screenplain/richstring.py @@ -91,7 +91,7 @@ class Segment(object): ordered_styles = list(self.styles) return ( ''.join(style.start_html for style in ordered_styles) + - cgi.escape(self.text) + + cgi.escape(self.text).encode('ascii', 'xmlcharrefreplace') + ''.join(style.end_html for style in reversed(ordered_styles)) ) |