Add escape argument to OutoutFormat.format_tag().
This commit is contained in:
parent
4dd082dffd
commit
8e4eb7d152
1 changed files with 4 additions and 3 deletions
|
|
@ -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}</{tag}>'.format(tag=tag, text=text)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue