From 6796675b0ec4d8305700b76c19ce4f92270522ee Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sat, 4 Mar 2023 16:11:09 +0000 Subject: [PATCH] fix markup in console live --- CHANGELOG.md | 1 + rich/live.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78b6fc3e..297ab123 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed duplicate output in Jupyter https://github.com/Textualize/rich/pulls/2804 - Filter ANSI character-encoding-change codes in `Text.from_ansi` parser - Fixes traceback failing when a frame filename is unreadable https://github.com/Textualize/rich/issues/2821 +- Fix for live update rendering console markup https://github.com/Textualize/rich/issues/2726 ### Added diff --git a/rich/live.py b/rich/live.py index e635fe5c..3ebbbc4c 100644 --- a/rich/live.py +++ b/rich/live.py @@ -210,6 +210,8 @@ class Live(JupyterMixin, RenderHook): renderable (RenderableType): New renderable to use. refresh (bool, optional): Refresh the display. Defaults to False. """ + if isinstance(renderable, str): + renderable = self.console.render_str(renderable) with self._lock: self._renderable = renderable if refresh: