Fix escaping text outside tags.

This commit is contained in:
Andrey Golovizin 2014-09-11 10:53:47 +02:00
parent 1c6509efad
commit 4dd082dffd

View file

@ -87,7 +87,8 @@ class HTMLFormat(OutputFormat):
def format_tag(self, tag, text):
from xml.sax.saxutils import escape
text = escape(text)
if tag:
return '<{tag}>{text}</{tag}>'.format(tag=tag, text=escape(text))
return '<{tag}>{text}</{tag}>'.format(tag=tag, text=text)
else:
return text