One function
escape in Textualize/rich
The author described this change as “fix at escape”. It counts as a record because the check below fails on the code as it stood at 1d5152ef5 and passes on 4b1293e00, with nothing else changed between the two runs.
ProjectTextualize/rich
Fix saved2022-01-02
Sharing licenceMIT · LICENSE
Change size+1 −1
What the code was meant to do, written into the code itself as a docstring
Escapes text so that it won't be interpreted as markup. Args: markup (str): Content to be inserted in to markup. Returns: str: Markup with square brackets escaped.
The change
| 1 | 1 | def escape( | |
| 2 | - | markup: str, _escape: _EscapeSubMethod = re.compile(r"(\\*)(\[[a-z#\/].*?\])").sub | |
| 2 | + | markup: str, _escape: _EscapeSubMethod = re.compile(r"(\\*)(\[[a-z#\/@].*?\])").sub | |
| 3 | 3 | ) -> str: | |
| 4 | 4 | """Escapes text so that it won't be interpreted as markup. | |
| 5 | 5 |
The check that tells the two apart
fail→pass·tests/test_markup.py::test_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 it1d5152ef52438f77db1d543beb03e972aa465962
Broken version dated2022-01-02
Modulerich.markup
Units changedescape
Fingerprintaf19d277f0c27ed1
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