doc: wikiparser: Sort imagedata properties

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2020-08-28 12:10:07 -04:00
1 parent cafbdaab19
commit 5f947ba1e7
1 file changed
+6 -2
+6 -2
View File
@@ -224,7 +224,8 @@ class EmbeddedAttachment(EmbeddedLink):
target = escape(self.target)
xml = '<inlinemediaobject><imageobject>'
xml += f'<imagedata fileref="{target}"'
xml += '<imagedata '
props = {'fileref': target}
if self.params:
params = self.params.split(',')
for param in params:
@@ -232,7 +233,10 @@ class EmbeddedAttachment(EmbeddedLink):
if prop == 'height':
prop = 'depth'
xml += ' ' + prop + '="' + value + '"'
props[prop] = value
props = [f'{prop}="{value}"' for prop, value in sorted(props.items())]
xml += ' '.join(props)
xml += '/>'
xml += '</imageobject>'