You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When one Span ends and another Span starts at the same index of a Text, the output of the markup 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:
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 replacing src with text throughout for consistency with the other tests?)
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.
The text was updated successfully, but these errors were encountered: