From 7b4134f351f15d0479efddd7d6cbcdd89e8a49b2 Mon Sep 17 00:00:00 2001 From: Ramforth Date: Thu, 30 Oct 2025 19:57:03 +0100 Subject: [PATCH] Fix rich markup interpretation in message_text using Text.from_markup() --- pytchat_listener.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pytchat_listener.py b/pytchat_listener.py index a450149..a2c9467 100644 --- a/pytchat_listener.py +++ b/pytchat_listener.py @@ -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") @@ -139,4 +141,4 @@ def main(): console.print(f"[green]Chat log saved to {log_filename}[/green]") if __name__ == '__main__': - main() + main() \ No newline at end of file