-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Colors break if there's an <
in the repr
#3024
Labels
Comments
MicaelJarniac
changed the title
[BUG] Colors break with attrs class with more than one enum
[BUG] Colors break with dataclass or attrs class with more than one enum
Jul 5, 2023
Same thing happens on macOS Ventura 13.4.1 with iTerm2. Doesn't seem like it's platform-dependent but @MicaelJarniac asked me to check :D |
MicaelJarniac
changed the title
[BUG] Colors break with dataclass or attrs class with more than one enum
[BUG] Colors break if there's an Jul 5, 2023
<
in the repr
I suspect the bug is in this line: Line 85 in aca9467
|
MicaelJarniac
added a commit
to MicaelJarniac/rich
that referenced
this issue
Jul 5, 2023
Closes Textualize#3024 Updated regex pattern to improve color formatting. The `tag_contents` group was updated to exclude `<` character (`[^<]`), preventing the matching of tags that contain other tags inside. Additionally, a `*?` was used for a non-greedy match, making the group match as little as possible, thus avoiding overreaching matches.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
If there's a
<
(less than) char in the repr of an object, the colors of other components that use<>
break after it.For example, if I have a dataclass or an attrs class with more than one enum attribute, the color of subsequent ones break when pretty printing.
On the terminal:
On Jupyter:
Platform
Click to expand
Operating System: Manjaro Linux
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9
Kernel Version: 6.1.31-2-MANJARO (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800H with Radeon Graphics
Memory: 13.5 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: LENOVO
Product Name: 82MJ
System Version: IdeaPad Gaming 3 15ACH6
Shell: Zsh with Zsh for Humans and Tmux
Terminal: VS Code's built-in terminal
If you're using Rich in a terminal:
`python -m rich.diagnose`
If you're using Rich in a Jupyter Notebook, run the following snippet in a cell
and paste the output in your bug report.
Report
The text was updated successfully, but these errors were encountered: