diff --git a/pixelocr/formatting.py b/pixelocr/formatting.py index b3388d6..8c4c36e 100644 --- a/pixelocr/formatting.py +++ b/pixelocr/formatting.py @@ -85,9 +85,10 @@ class HTMLFormat(OutputFormat): else: return None - def format_tag(self, tag, text): - from xml.sax.saxutils import escape - text = escape(text) + def format_tag(self, tag, text, escape=True): + from xml.sax import saxutils + if escape: + text = saxutils.escape(text) if tag: return '<{tag}>{text}'.format(tag=tag, text=text) else: