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 @@ -659,9 +659,12 @@ def render(self, console: Console) -> str:
659659 render = Style .render
660660 self ._render_cache = "" .join (
661661 [
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+ )
663667 for text , style , _ in self ._segments
664- if style is not None
665668 ]
666669 )
667670 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