Sort declarations in style attribute (#107)
This commit is contained in:
parent
3929426a5a
commit
dc3f66ed0f
1 changed files with 3 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue