File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
20
20
- Added ` App.viewport_size ` https://github.com/Textualize/textual/pull/6105
21
21
- Added ` Screen.size ` https://github.com/Textualize/textual/pull/6105
22
22
23
+ ### Fixed
24
+
25
+ - Fixed issue where Segments with a style of ` None ` aren't rendered https://github.com/Textualize/textual/pull/6109
26
+
23
27
## [ 6.1.0] - 2025-08-01
24
28
25
29
### Added
Original file line number Diff line number Diff line change @@ -659,9 +659,12 @@ def render(self, console: Console) -> str:
659
659
render = Style .render
660
660
self ._render_cache = "" .join (
661
661
[
662
- render (style , text , color_system = color_system )
662
+ (
663
+ text
664
+ if style is None
665
+ else render (style , text , color_system = color_system )
666
+ )
663
667
for text , style , _ in self ._segments
664
- if style is not None
665
668
]
666
669
)
667
670
return self ._render_cache
Original file line number Diff line number Diff line change 1
1
import pytest
2
+ from rich .console import Console
2
3
from rich .segment import Segment
3
4
from rich .style import Style
4
5
@@ -196,3 +197,9 @@ def test_text():
196
197
assert Strip ([]).text == ""
197
198
assert Strip ([Segment ("foo" )]).text == "foo"
198
199
assert Strip ([Segment ("foo" ), Segment ("bar" )]).text == "foobar"
200
+
201
+
202
+ def test_render_with_missing_style () -> None :
203
+ """Test that render with segments that omit a style still work."""
204
+ strip = Strip ([Segment ("Hello" )])
205
+ assert strip .render (Console ()) == "Hello"
You can’t perform that action at this time.
0 commit comments