← oracle_refix

rich_4079

resolved RESOLVED UNSUBMITTED PASS · None tool calls · 0 s · Textualize/rich

Task input

Inline table code

Fixes https://github.com/Textualize/rich/issues/4038

Tool calls (0)

#ToolArgumentsResult
No trace captured.

Patch

--- a/rich/markdown.py
+++ b/rich/markdown.py
@@ -331,9 +331,10 @@ def __init__(self, justify: JustifyMethod) -> None:
         self.justify = justify
 
     def on_text(self, context: MarkdownContext, text: TextType) -> None:
-        text = Text(text) if isinstance(text, str) else text
-        text.stylize(context.current_style)
-        self.content.append_text(text)
+        if isinstance(text, str):
+            self.content.append(text, context.current_style)
+        else:
+            self.content.append_text(text)
 
 
 class ListElement(MarkdownElement):

Test output

show
........                                                                 [100%]
8 passed in 0.19s