fix(post_parser): correct content order when caption display flag is toggled
The changes ensure that when `show_caption_above` is true, text content is rendered before media, and when false, media is rendered before text. This aligns the actual rendering order with the semantic meaning of the flag, fixing a bug where content ordering did not match user expectations.
This commit is contained in:
+7
-6
@@ -615,19 +615,20 @@ class PostParser:
|
||||
show_caption_above = getattr(message, 'show_caption_above_media', False)
|
||||
|
||||
if show_caption_above:
|
||||
if media_html:
|
||||
content_body.append(media_html)
|
||||
content_body.append("<br>")
|
||||
if text_html:
|
||||
content_body.append(text_html)
|
||||
content_body.append("<br>")
|
||||
if media_html:
|
||||
content_body.append(media_html)
|
||||
content_body.append("<br>")
|
||||
else:
|
||||
if text_html:
|
||||
content_body.append(text_html)
|
||||
content_body.append("<br>")
|
||||
if media_html:
|
||||
content_body.append(media_html)
|
||||
content_body.append("<br>")
|
||||
if text_html:
|
||||
content_body.append(text_html)
|
||||
content_body.append("<br>")
|
||||
|
||||
|
||||
if poll_html: content_body.append(poll_html) # Poll
|
||||
if message.forward_origin: content_body.append(f"--- Forwarded post end ---") # Forward info end
|
||||
|
||||
Reference in New Issue
Block a user