Skip to content

Commit 29fad94

Browse files
committed
Simplify the retheme method
Also use get_child_by_type to ensure it's just our child (not really necessary but more in keeping with the makeup of the widget).
1 parent 88dfe45 commit 29fad94

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/textual/widgets/_markdown.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,7 @@ def _retheme(self) -> None:
529529
if self.app.dark
530530
else self._markdown.code_light_theme
531531
)
532-
code_block = self.query_one(Static)
533-
code_block.update(self._block())
532+
self.get_child_by_type(Static).update(self._block())
534533

535534
def compose(self) -> ComposeResult:
536535
yield Static(

0 commit comments

Comments
 (0)