Overriding existing style #871
-
If I have an existing Text object (or some other renderable), is there a way to override an existing style on it? For instance, let's say that I have a I've tried passing a style on the print() of this object, but the style set on the Text object seem to take precedence, with anything on the print() only being able to set additional styles which were not previously set. The specific use case here is that I want to accept markup text from an external source but then force certain styles on that input (such as disabling blinking) before rendering it. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can negate styles, which may have the effect you are looking for. Something like this: t = Text.from_markup("[bold red]some text[/]")
t.stylize("not bold") |
Beta Was this translation helpful? Give feedback.
You can negate styles, which may have the effect you are looking for. Something like this: