forked from github/pelican
handle escaped chars in html properly
This commit is contained in:
parent
56800a1d43
commit
c0578eb9ab
1 changed files with 6 additions and 0 deletions
|
|
@ -196,6 +196,12 @@ class HTMLReader(Reader):
|
|||
def handle_data(self, data):
|
||||
self._data_buffer += data
|
||||
|
||||
def handle_entityref(self, data):
|
||||
self._data_buffer += '&{};'.format(data)
|
||||
|
||||
def handle_charref(self, data):
|
||||
self._data_buffer += '&{};'.format(data)
|
||||
|
||||
def build_tag(self, tag, attrs, close_tag):
|
||||
result = '<{}'.format(cgi.escape(tag))
|
||||
result += ''.join((' {}="{}"'.format(cgi.escape(k), cgi.escape(v)) for k,v in attrs))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue