aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--screenplain/richstring.py2
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))
)