aboutsummaryrefslogtreecommitdiff
path: root/mammoth
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2019-10-31 10:52:06 +0000
committerMichael Williamson <mike@zwobble.org>2019-10-31 10:52:06 +0000
commit732eb3019cc11ff9f2b9dcdfabd524f12885a9f0 (patch)
tree296003e1fca8141c7dec03324e90bfb049a293ba /mammoth
parent1ed67954b9612e1d764172e6c8abbddc05ebd436 (diff)
parent1599d4ed14fb3d7c7e551c9f6ce3f86d9df17cbd (diff)
Merge remote-tracking branch 'messense/patch-1' into python-3.8
Diffstat (limited to 'mammoth')
-rw-r--r--mammoth/writers/html.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/mammoth/writers/html.py b/mammoth/writers/html.py
index 7e6ca95..262d79e 100644
--- a/mammoth/writers/html.py
+++ b/mammoth/writers/html.py
@@ -1,9 +1,8 @@
from __future__ import unicode_literals
+from xml.sax.saxutils import escape
from .abc import Writer
-import cgi
-
class HtmlWriter(Writer):
def __init__(self):
@@ -31,7 +30,7 @@ class HtmlWriter(Writer):
def _escape_html(text):
- return cgi.escape(text, quote=True)
+ return escape(text, {'"': "&quot;"})
def _generate_attribute_string(attributes):