Don't escape quotes ('/") in text nodes and attributes.
- In text nodes quotes are fine - In attributes quotes are fine if used reciprocally. Escaping in the latter case often causes issues, e.g. with quoted font names (#21) or inline CSS styles (#56), while it probably does not gain anything (if quotes are wrongly used in attribute names the XML is most likely invalid to start with)
This commit is contained in:
parent
fe2884c3e8
commit
738b7d7c5d
2 changed files with 5 additions and 2 deletions
|
|
@ -2752,7 +2752,10 @@ def remapNamespacePrefix(node, oldprefix, newprefix):
|
|||
|
||||
|
||||
def makeWellFormed(str):
|
||||
xml_ents = { '<':'<', '>':'>', '&':'&', "'":''', '"':'"'}
|
||||
# Don't escape quotation marks for now as they are fine in text nodes
|
||||
# as well as in attributes if used reciprocally
|
||||
# xml_ents = { '<':'<', '>':'>', '&':'&', "'":''', '"':'"'}
|
||||
xml_ents = { '<':'<', '>':'>', '&':'&'}
|
||||
|
||||
# starr = []
|
||||
# for c in str:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue