One function
render in Textualize/rich
The author described this change as “Fix issue with markup escaping”. It counts as a record because the check below fails on the code as it stood at ae5865eb7 and passes on 71325bb5b, with nothing else changed between the two runs.
ProjectTextualize/rich
Fix saved2022-02-10
Sharing licenceMIT · LICENSE
Change size+2 −0
What the code was meant to do, written into the code itself as a docstring
Render console markup in to a Text instance. Args: markup (str): A string containing console markup. emoji (bool, optional): Also render emoji code. Defaults to True. Raises: MarkupError: If there is a syntax error in the markup. Returns: Text: A test instance.
The change
| 44 | 44 | ||
| 45 | 45 | for position, plain_text, tag in _parse(markup): | |
| 46 | 46 | if plain_text is not None: | |
| 47 | + | # Capture open brace escapes, where the brace is not part of a tag. | |
| 48 | + | plain_text = plain_text.replace("\\[", "[") | |
| 47 | 49 | append(emoji_replace(plain_text) if emoji else plain_text) | |
| 48 | 50 | elif tag is not None: | |
| 49 | 51 | if tag.name.startswith("/"): # Closing tag |
The check that tells the two apart
fail→pass·tests/test_markup.py::test_markup_escape
Check file tests/test_markup.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before itae5865eb799de4c6ed6bdfa29f696d9104219229
Broken version dated2022-02-09
Modulerich.markup
Units changedrender
Fingerprintf71a3138a8ba3986
Checked2026-08-17 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in Textualize/rich
- 2026-04-12TableDataElement
- 2026-02-01_cell_len
- 2026-01-24get_character_cell_size
- 2025-11-13Fix raw markup printed on prompt errors sometimes
- 2025-05-01fix(panel): fix title missing panel background
- 2024-10-03fix(table): highlight columns added by add_row