← baseline_full_v2

rich_3130

failed NO_PATCH NO_PATCH UNSUBMITTED empty_patch(None) · None tool calls · 0 s · Textualize/rich

Task input

Fix markdown table rendering issue with inline styles/links

## Type of changes

- [x] Bug fix
- [ ] New feature
- [ ] Documentation / docstrings
- [x] Tests
- [ ] Other

## Checklist

- [x] I've run the latest [black](https://github.com/psf/black) with default args on new code.
- [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
- [x] I've added tests for new code.
- [x] I accept that @willmcgugan may be pedantic in the code review.

## Description

The table data elements were not interacting well with inline styles (in the rich sense) and the table data element would have its content overridden every time we found another excerpt of text with a different style.
The fix was to do something similar to what `TextElement` does in its method `on_text`, which is to append the new content instead of replacing it.

This fixes #3115.

Tool calls (0)

#ToolArgumentsResult
No trace captured.

Test output

show
                                                                       \x1b[0m\n\x1b[1;33m   \x1b[0m\x1b[48;2;39;40;34m \x1b[0m\x1b[48;2;39;40;34mCode block                                                                                     \x1b[0m\x1b[48;2;39;40;34m \x1b[0m\n\x1b[1;33m   \x1b[0m\x1b[48;2;39;40;34m                                                                                                 \x1b[0m\n"
>       assert rendered_markdown == expected
E       AssertionError: assert '┏━━━━━━━━━━━...           \n' == '┏━━━━━━━━━━━...    \x1b[0m\n'
E         
E         Skipping 1211 identical leading characters in diff, use -v to show
E         - d, monospace.                                                            
E         ?           ------
E         + d, monospace.                                                            
E           
E           Horizontal rule:                                                                                    ...
E         
E         ...Full output truncated (85 lines hidden), use '-vv' to show

tests/test_markdown.py:103: AssertionError
----------------------------- Captured stdout call -----------------------------
'┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n┃                                             \x1b[1mHeading\x1b[0m                                              ┃\n┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n\n\n                                            \x1b[1;4mSub-heading\x1b[0m                                             \n\n                                              \x1b[1mHeading\x1b[0m                                               \n\n                                             \x1b[1;2mH4 Heading\x1b[0m                                             \n\n                                             \x1b[4mH5 Heading\x1b[0m                                             \n\n                                             \x1b[3mH6 Heading\x1b[0m                                             \n\nParagraphs are separated by a blank line.                                                           \n\nTwo spaces at the end of a line                                                                     \nproduces a line break.                                                                              \n\nText attributes \x1b[3mitalic\x1b[0m, \x1b[1mbold\x1b[0m, \x1b[1mmonospace\x1b[0m.                                                            \n\nHorizontal rule:                                                                                    \n\n────────────────────────────────────────────────────────────────────────────────────────────────────\nBullet list:                                                                                        \n\n\x1b[1m • \x1b[0mapples                                                                                           \n\x1b[1m • \x1b[0moranges                                                                                          \n\x1b[1m • \x1b[0mpears                                                                                            \n\nNumbered list:                                                                                      \n\n\x1b[1m 1 \x1b[0mlather                                                                                           \n\x1b[1m 2 \x1b[0mrinse                                                                                            \n\x1b[1m 3 \x1b[0mrepeat                                                                                           \n\nAn \x1b]8;id=0;foo\x1b\\\x1b[4mexample\x1b[0m\x1b]8;;\x1b\\.                                                                                         \n\n▌ Markdown uses email-style > characters for blockquoting.                                        \n▌ Lorem ipsum                                                                                     \n\n🌆 \x1b]8;id=0;foo\x1b\\progress\x1b]8;;\x1b\\                                                                                         \n\n                                                                                                    \n a=1                                                                                                \n                                                                                                    \n\n                                                                                                    \n import this                                                                                        \n                                                                                                    \n\n                                                                                                    \n foobar                                                                                             \n                                                                                                    \n\n                                                                                                    \n import this                                                                                        \n                                                                                                    \n\n\x1b[1m 1 \x1b[0mList item                                                                                        \n\x1b[1m   \x1b[0m                                                                                                 \n\x1b[1m   \x1b[0m Code block                                                                                      \n\x1b[1m   \x1b[0m                                                                                                 \n'
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
1 failed in 0.27s