You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed the following odd behavior: when using rich.print with bbcode tags, if the string contains matching quotes the substring between the quotes is colored green.
fromrichimportprint# Contains a quote pair, Malley is printed in greenprint("[bold]O'Malley's Bar[/bold]")
# Only one quote, prints as expectedprint("[bold]O'Malleys Bar[/bold]")
I've tried this with a few different tags, swapping the internal quote types, and using Console.print() but all show the same behavior.
The text was updated successfully, but these errors were encountered:
After using this more it looks like print is formatting the string as if it were python code. Quoted strings turn green, obvious numerics are purple. Keywords aren't affected. Also, all content inside of brackets is being eaten regardless of if it is a valid bbcode tag or not.
Rich will highlight repr strings by default. I can probably harden the regex to avoid that issue, but in the meantime you can disable highlighting by passing highlight=False to Console.print or to the Console constructor.
Unknown tags are left in because the styles depend on the theme. You wouldn't want the text left in just because a theme was missing a style. You can disable the markup in the same way as highlighting with markup=False.
Nice module!
I've noticed the following odd behavior: when using rich.print with bbcode tags, if the string contains matching quotes the substring between the quotes is colored green.
I've tried this with a few different tags, swapping the internal quote types, and using Console.print() but all show the same behavior.
The text was updated successfully, but these errors were encountered: