Qt comments editor add a margin for floating images Qt itself doesnt render it but it is rendered in the server

This commit is contained in:
Kovid Goyal 2023-10-21 17:47:37 +05:30
parent b072a49193
commit 4c61274d09
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -213,6 +213,13 @@ def cleanup_qt_markup(root):
if ts:
remove_margins(li, ts)
remove_zero_indents(ts)
for img in root.xpath('//img[@style]'):
s = style_map.get(img)
if s:
if s == {'float': 'left'}:
s['margin-right'] = '0.5em'
elif s == {'float': 'right'}:
s['margin-left'] = '0.5em'
for style in itervalues(style_map):
filter_qt_styles(style)
fw = style.get('font-weight')