Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Added `App.viewport_size` https://github.com/Textualize/textual/pull/6105
- Added `Screen.size` https://github.com/Textualize/textual/pull/6105

### Fixed

- Fixed issue where Segments with a style of `None` aren't rendered https://github.com/Textualize/textual/pull/6109

## [6.1.0] - 2025-08-01

### Added
Expand Down
7 changes: 5 additions & 2 deletions src/textual/strip.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,9 +659,12 @@ def render(self, console: Console) -> str:
render = Style.render
self._render_cache = "".join(
[
render(style, text, color_system=color_system)
(
text
if style is None
else render(style, text, color_system=color_system)
)
for text, style, _ in self._segments
if style is not None
]
)
return self._render_cache
Expand Down
7 changes: 7 additions & 0 deletions tests/test_strip.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
from rich.console import Console
from rich.segment import Segment
from rich.style import Style

Expand Down Expand Up @@ -196,3 +197,9 @@ def test_text():
assert Strip([]).text == ""
assert Strip([Segment("foo")]).text == "foo"
assert Strip([Segment("foo"), Segment("bar")]).text == "foobar"


def test_render_with_missing_style() -> None:
"""Test that render with segments that omit a style still work."""
strip = Strip([Segment("Hello")])
assert strip.render(Console()) == "Hello"
Loading