mirror of
https://github.com/getpelican/pelican.git
synced 2026-05-27 15:46:14 +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:
|
for k, v in attrs:
|
||||||
result += ' ' + escape(k)
|
result += ' ' + escape(k)
|
||||||
if v is not None:
|
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:
|
if close_tag:
|
||||||
return result + ' />'
|
return result + ' />'
|
||||||
return result + '>'
|
return result + '>'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue