Escape special chars like "&"
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
ce582d9534
commit
b199056944
2 changed files with 6 additions and 2 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import html
|
||||||
import os
|
import os
|
||||||
|
|
||||||
BTN_LEFT = 1
|
BTN_LEFT = 1
|
||||||
|
@ -77,6 +78,9 @@ class Block:
|
||||||
text=text,
|
text=text,
|
||||||
))
|
))
|
||||||
|
|
||||||
|
def safe_text(self, text):
|
||||||
|
return html.escape(text)
|
||||||
|
|
||||||
def set_icon(self, icon):
|
def set_icon(self, icon):
|
||||||
"""
|
"""
|
||||||
Overwrites the icon speicfied in constructor
|
Overwrites the icon speicfied in constructor
|
||||||
|
|
|
@ -50,10 +50,10 @@ class Spotify(Block):
|
||||||
'Metadata',
|
'Metadata',
|
||||||
)
|
)
|
||||||
|
|
||||||
return "{} - {}".format(
|
return self.safe_text("{} - {}".format(
|
||||||
meta.get('xesam:artist')[0],
|
meta.get('xesam:artist')[0],
|
||||||
meta.get('xesam:title'),
|
meta.get('xesam:title'),
|
||||||
)
|
))
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
Loading…
Reference in a new issue