Skip to content

Commit b6c59ca

Browse files
authored
Escape [...] in text for rich display (onnx#243)
Previously `[...]` was not displayed correct due to how rich handles the text. This change fixes it by escaping the text. Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
1 parent 49ac584 commit b6c59ca

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/onnx_ir/_display.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ def display(self, *, page: bool = False) -> None:
3939
)
4040
return
4141

42+
import rich.markup
43+
44+
# Escape text to display `[...]` correctly
45+
text = rich.markup.escape(text)
46+
4247
if page:
4348
import rich.console
4449

0 commit comments

Comments
 (0)