mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
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:
parent
cafbdaab19
commit
5f947ba1e7
@ -224,7 +224,8 @@ class EmbeddedAttachment(EmbeddedLink):
|
|||||||
target = escape(self.target)
|
target = escape(self.target)
|
||||||
|
|
||||||
xml = '<inlinemediaobject><imageobject>'
|
xml = '<inlinemediaobject><imageobject>'
|
||||||
xml += f'<imagedata fileref="{target}"'
|
xml += '<imagedata '
|
||||||
|
props = {'fileref': target}
|
||||||
if self.params:
|
if self.params:
|
||||||
params = self.params.split(',')
|
params = self.params.split(',')
|
||||||
for param in params:
|
for param in params:
|
||||||
@ -232,7 +233,10 @@ class EmbeddedAttachment(EmbeddedLink):
|
|||||||
if prop == 'height':
|
if prop == 'height':
|
||||||
prop = 'depth'
|
prop = 'depth'
|
||||||
|
|
||||||
xml += ' ' + prop + '="' + value + '"'
|
props[prop] = value
|
||||||
|
|
||||||
|
props = [f'{prop}="{value}"' for prop, value in sorted(props.items())]
|
||||||
|
xml += ' '.join(props)
|
||||||
|
|
||||||
xml += '/>'
|
xml += '/>'
|
||||||
xml += '</imageobject>'
|
xml += '</imageobject>'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user