mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
HTML attribute quotes now properly handled. Issue #1260
This commit is contained in:
parent
a9d1fdae3d
commit
bbd6f253cc
1 changed files with 5 additions and 1 deletions
|
|
@ -297,7 +297,11 @@ class HTMLReader(BaseReader):
|
|||
for k, v in attrs:
|
||||
result += ' ' + escape(k)
|
||||
if v is not None:
|
||||
result += '="{}"'.format(escape(v))
|
||||
# figure out the proper surrounding quote-marks
|
||||
if '"' in v:
|
||||
result += "='{}'".format(escape(v))
|
||||
else:
|
||||
result += '="{}"'.format(escape(v))
|
||||
if close_tag:
|
||||
return result + ' />'
|
||||
return result + '>'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue