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:
Eduard Braun 2016-09-11 14:01:04 +02:00
parent b065137187
commit 082b579410
3 changed files with 10 additions and 1 deletions

View file

@ -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