Enabling console highlighting only for specific prints #3461
-
Hi, according to https://rich.readthedocs.io/en/latest/highlighting.html#highlighting I can enable/disable highlighting globally but then per print() call, but somehow I cannot get this to work. I tried: import rich.console
con = rich.console.Console(highlight = False )
con.print("test POST https://www.google.de 'string' now [red]RED[/]")
con.print("test POST https://www.google.de 'string' now [red]RED[/]",highlight = True)
con.print("test POST https://www.google.de 'string' now [red]RED[/]",highlight = False) the highlighting is disabled in all three cases. When I set it to True in the Console() ctor then the first two are highlighted, the third is not. How can I get the highlight=True print to work? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I think unfortunately this may be a bug in Rich. This is raised recently in #3419 and I have submitted PR #3420 waiting review. |
Beta Was this translation helpful? Give feedback.
-
This should now be fixed in the latest release (v13.8.0). |
Beta Was this translation helpful? Give feedback.
This should now be fixed in the latest release (v13.8.0).