sort style declarations

This commit is contained in:
Dirk Thomas 2016-08-30 15:55:46 -07:00
parent 3929426a5a
commit ec2a533a35

View file

@ -3000,6 +3000,9 @@ def serializeXML(element, options, ind = 0, preserveWhitespace = False):
quot = "'"
attrValue = makeWellFormed( attr.nodeValue )
if attr.nodeName == 'style':
# sort declarations
attrValue = '; '.join([p for p in sorted(attrValue.split(';'))])
outParts.append(' ')
# preserve xmlns: if it is a namespace prefix declaration