From 5266e08a26704942de1db33309b4f10367d3e9ca Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Mon, 30 Dec 2019 13:29:34 +0100 Subject: [PATCH] [core/output] Escape pango output Make sure any "&" are properly escaped if using pango markup. fixes #507 --- bumblebee/output.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bumblebee/output.py b/bumblebee/output.py index f4194a9..99d59c5 100644 --- a/bumblebee/output.py +++ b/bumblebee/output.py @@ -156,6 +156,11 @@ class I3BarOutput(object): if width: full_text = full_text.ljust(len(width) + len(prefix) + len(suffix)) + markup = "none" if not self._config else self._config.markup() + + if markup == "pango": + full_text = full_text.replace("&", "&") + self._widgets.append({ u"full_text": full_text, "color": self._theme.fg(widget), @@ -167,7 +172,7 @@ class I3BarOutput(object): "align": self._theme.align(widget), "instance": widget.id, "name": module.id, - "markup": "none" if not self._config else self._config.markup(), + "markup": markup, }) def begin(self):