mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
fix null attributes in html parser
This commit is contained in:
parent
f3bc2ece86
commit
08439bdcf1
3 changed files with 22 additions and 1 deletions
|
|
@ -240,7 +240,10 @@ class HTMLReader(Reader):
|
|||
|
||||
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))
|
||||
for k,v in attrs:
|
||||
result += ' ' + cgi.escape(k)
|
||||
if v is not None:
|
||||
result += '="{}"'.format(cgi.escape(v))
|
||||
if close_tag:
|
||||
return result + ' />'
|
||||
return result + '>'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue