Open slaarti opened 1 year ago
As long as the markup renders the expected output, then I don't consider it to be a problem.
That said, I would accept a PR that more closely reflected the original markup
Yeah, that's totally fair. I've put in PR #3163.
Describe the bug
When one
Span
ends and anotherSpan
starts at the same index of aText
, the output of themarkup
property will render the opening tag of the second before the closing tag of the first. I've actually written a unit test in preparation for possibly attempting to solve this myself and file a PR:And running the test:
I know there are probably corner cases where
from_markup
/markup
round-tripping won't be 100% correct, but IMO it'd be nice to get closer.(Also, I was tempted to compact the last two lines of the test into
assert Text.from_markup(src).markup == src
; would this be preferable, possibly also replacingsrc
withtext
throughout for consistency with the other tests?)Platform
Click to expand
macOS Ventura, Python 3.11.6, iTerm2 3.4.21, Rich 13.6.0. ``` (rich-py3.11) $ python -m rich.diagnose ╭───────────────────────