summaryrefslogtreecommitdiff
path: root/spotify-widget
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2020-04-30 09:04:52 -0400
committerstreetturtle <streetturtle@gmail.com>2020-04-30 09:04:52 -0400
commite9131c266bf2ffedfa0e272afd1b365863374a55 (patch)
tree8477c1582b248d430e7c94e1ba18830731a37100 /spotify-widget
parent5a8113dfae7a3446c951fe27df41d6859c6db247 (diff)
escape ampersand, fix #136
Diffstat (limited to 'spotify-widget')
-rw-r--r--spotify-widget/spotify.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/spotify-widget/spotify.lua b/spotify-widget/spotify.lua
index e826de9..f8b2b62 100644
--- a/spotify-widget/spotify.lua
+++ b/spotify-widget/spotify.lua
@@ -50,11 +50,12 @@ local function worker(args)
end
local update_widget_text = function(widget, stdout, _, _, _)
+ local escaped = string.gsub(stdout, "&", '&amp;')
if string.find(stdout, 'Error: Spotify is not running.') ~= nil then
widget:set_text('')
widget:set_visible(false)
else
- widget:set_text(stdout)
+ widget:set_text(escaped)
widget:set_visible(true)
end
end