[core/output] Escape pango output
Make sure any "&" are properly escaped if using pango markup. fixes #507
This commit is contained in:
parent
3b9b0478fc
commit
5266e08a26
1 changed files with 6 additions and 1 deletions
|
@ -156,6 +156,11 @@ class I3BarOutput(object):
|
||||||
if width:
|
if width:
|
||||||
full_text = full_text.ljust(len(width) + len(prefix) + len(suffix))
|
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({
|
self._widgets.append({
|
||||||
u"full_text": full_text,
|
u"full_text": full_text,
|
||||||
"color": self._theme.fg(widget),
|
"color": self._theme.fg(widget),
|
||||||
|
@ -167,7 +172,7 @@ class I3BarOutput(object):
|
||||||
"align": self._theme.align(widget),
|
"align": self._theme.align(widget),
|
||||||
"instance": widget.id,
|
"instance": widget.id,
|
||||||
"name": module.id,
|
"name": module.id,
|
||||||
"markup": "none" if not self._config else self._config.markup(),
|
"markup": markup,
|
||||||
})
|
})
|
||||||
|
|
||||||
def begin(self):
|
def begin(self):
|
||||||
|
|
Loading…
Reference in a new issue