Fix rich markup interpretation in message_text using Text.from_markup()

This commit is contained in:
2025-10-30 19:57:03 +01:00
parent 061276618e
commit 7b4134f351

View File

@@ -112,9 +112,11 @@ def main():
# Create a Text object for the username and apply style directly
username_text = Text(f"{author_display_name}: ", style=username_style)
# Create a Text object for the full message
# Pass markup=True to interpret rich markup within message_text
full_message_text = Text.assemble(username_text, Text(message_text, markup=True))
# Create a Text object for the message, interpreting rich markup
message_text_rich = Text.from_markup(message_text)
# Assemble the full message
full_message_text = Text.assemble(username_text, message_text_rich)
# Alternate background styles
background_style = Style(bgcolor="#2B2B2B") if message_count % 2 == 0 else Style(bgcolor="#3A3A3A")