diff --git a/kvui.py b/kvui.py index 500203a8..1409e2dc 100644 --- a/kvui.py +++ b/kvui.py @@ -836,6 +836,10 @@ class KivyJSONtoTextParser(JSONtoTextParser): return self._handle_text(node) def _handle_text(self, node: JSONMessagePart): + # All other text goes through _handle_color, and we don't want to escape markup twice, + # or mess up text that already has intentional markup applied to it + if node.get("type", "text") == "text": + node["text"] = escape_markup(node["text"]) for ref in node.get("refs", []): node["text"] = f"[ref={self.ref_count}|{ref}]{node['text']}[/ref]" self.ref_count += 1