We don't want spaces in the serialized value of style attributes.
Add a unittest that should catch this and other issues with parsing/serializing the `style` attribute
This commit is contained in:
parent
b065137187
commit
082b579410
3 changed files with 10 additions and 1 deletions
|
|
@ -3105,7 +3105,7 @@ def serializeXML(element, options, ind = 0, preserveWhitespace = False):
|
|||
attrValue = makeWellFormed( attr.nodeValue )
|
||||
if attr.nodeName == 'style':
|
||||
# sort declarations
|
||||
attrValue = '; '.join([p for p in sorted(attrValue.split(';'))])
|
||||
attrValue = ';'.join([p for p in sorted(attrValue.split(';'))])
|
||||
|
||||
outParts.append(' ')
|
||||
# preserve xmlns: if it is a namespace prefix declaration
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue