Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save w-flo/5563856 to your computer and use it in GitHub Desktop.
Save w-flo/5563856 to your computer and use it in GitHub Desktop.
From 0018a24f75f0212683a8d1bf23db26bcab1460ea Mon Sep 17 00:00:00 2001
From: Florian Will <florian.will@gmail.com>
Date: Sun, 12 May 2013 16:16:51 +0200
Subject: [PATCH] Escape artist and album name in album widget.
---
src/widgets.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/widgets.js b/src/widgets.js
index 069d58b..21aef63 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -181,8 +181,10 @@ const AlbumWidget = new Lang.Class({
pixbuf = albumArtCache.makeDefaultIcon(256, 256);
this.ui.get_object("cover").set_from_pixbuf (pixbuf);
- this.ui.get_object("artist_label").set_markup(artist);
- this.ui.get_object("title_label").set_markup(album);
+ let escapedArtist = GLib.markup_escape_text(artist, -1);
+ let escapedAlbum = GLib.markup_escape_text(album, -1);
+ this.ui.get_object("artist_label").set_markup(escapedArtist);
+ this.ui.get_object("title_label").set_markup(escapedAlbum);
if (item.get_creation_date())
this.ui.get_object("released_label_info").set_text(item.get_creation_date().get_year().toString());
else
--
1.8.1.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment