Properly rendering rich text even if start tags are no longer visible #1353
-
I'm working on a in-terminal text viewer of sorts. It displays text using the My question, what is the best way of allowing scrolling while also not causing formatting errors. Any help would be appreciated. I know it's a weird question but I seriously feel like I'm doing it wrong. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You probably don't want to do basic string operations on console markup if there is a chance you can break tags. You can convert console markup in to a Text instance, and then further process it. Here's how you can generate a Text object from markup: text = Text.from_markup(my_markup) |
Beta Was this translation helpful? Give feedback.
You probably don't want to do basic string operations on console markup if there is a chance you can break tags.
You can convert console markup in to a Text instance, and then further process it.
Here's how you can generate a Text object from markup: