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/).
2020- Added ` App.viewport_size ` https://github.com/Textualize/textual/pull/6105
2121- Added ` Screen.size ` https://github.com/Textualize/textual/pull/6105
2222
23+ ### Fixed
24+
25+ - Fixed issue where Segments with a style of ` None ` aren't rendered https://github.com/Textualize/textual/pull/6109
26+
2327## [ 6.1.0] - 2025-08-01
2428
2529### Added
Original file line number Diff line number Diff line change @@ -711,9 +711,12 @@ def render(self, console: Console) -> str:
711711 render = self .render_style
712712 self ._render_cache = "" .join (
713713 [
714- render (style , text , color_system = color_system )
714+ (
715+ text
716+ if style is None
717+ else render (style , text , color_system = color_system )
718+ )
715719 for text , style , _ in self ._segments
716- if style is not None
717720 ]
718721 )
719722 return self ._render_cache
Original file line number Diff line number Diff line change 11import pytest
2+ from rich .console import Console
23from rich .segment import Segment
34from rich .style import Style
45
@@ -196,3 +197,9 @@ def test_text():
196197 assert Strip ([]).text == ""
197198 assert Strip ([Segment ("foo" )]).text == "foo"
198199 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