diff --git a/CHANGELOG.md b/CHANGELOG.md index a4447de29..25eb9a908 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Bumped minimum Python version to 3.7 https://github.com/Textualize/rich/pull/2567 +- Pretty-printing of "tagged" `__repr__` results is now greedy when matching tags https://github.com/Textualize/rich/pull/2565 ## [12.6.0] - 2022-10-02 diff --git a/tests/test_highlighter.py b/tests/test_highlighter.py index a9d036ba9..804efb369 100644 --- a/tests/test_highlighter.py +++ b/tests/test_highlighter.py @@ -5,10 +5,10 @@ import pytest from rich.highlighter import ( + ISO8601Highlighter, JSONHighlighter, NullHighlighter, ReprHighlighter, - ISO8601Highlighter, ) from rich.text import Span, Text @@ -30,6 +30,26 @@ def test_wrong_type(): Span(4, 5, "repr.tag_end"), ], ), + ( + "", + [ + Span(0, 1, "repr.tag_start"), + Span(1, 5, "repr.tag_name"), + Span(5, 8, "repr.tag_contents"), + Span(8, 9, "repr.tag_end"), + Span(6, 8, "repr.number"), + ], + ), + ( + ">", + [ + Span(0, 1, "repr.tag_start"), + Span(1, 5, "repr.tag_name"), + Span(5, 15, "repr.tag_contents"), + Span(15, 16, "repr.tag_end"), + Span(12, 14, "repr.number"), + ], + ), ( "False True None", [