[gnome-maps] PlaceBubble: Handle colon in Wikipedia articles
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] PlaceBubble: Handle colon in Wikipedia articles
- Date: Mon, 6 Mar 2017 20:07:52 +0000 (UTC)
commit 9021ef6d7f3b01057038d01e10b3e658f26ccc3b
Author: Marcus Lundblad <ml update uu se>
Date: Sun Feb 26 22:12:27 2017 +0100
PlaceBubble: Handle colon in Wikipedia articles
Properly handle a colon (:) character in a Wikipedia
tag. Also URI escape the article part to avoid pontential
problems, like & or ? in titles.
https://bugzilla.gnome.org/show_bug.cgi?id=779097
src/placeBubble.js | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/placeBubble.js b/src/placeBubble.js
index 5a1449b..b437e2d 100644
--- a/src/placeBubble.js
+++ b/src/placeBubble.js
@@ -105,9 +105,10 @@ const PlaceBubble = new Lang.Class({
_formatWikiLink: function(wiki) {
let tokens = wiki.split(':');
+ let lang = tokens[0];
+ let article = GLib.markup_escape_text(tokens.splice(1).join(':'), -1);
- return Format.vprintf('https://%s.wikipedia.org/wiki/%s', [ tokens[0],
- tokens[1] ]);
+ return Format.vprintf('https://%s.wikipedia.org/wiki/%s', [ lang, article ]);
},
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]