]> git.eshelyaron.com Git - emacs.git/commitdiff
(shr-urlify): Decode URLs before using them as titles
authorIvan Shmakov <ivan@siamics.net>
Sat, 10 Jan 2015 16:48:38 +0000 (17:48 +0100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 10 Jan 2015 16:48:38 +0000 (17:48 +0100)
Fixes: debbugs:19555
* lisp/net/shr.el (shr-urlify): Decode URLs before using them as titles.

lisp/ChangeLog
lisp/net/shr.el

index 6c67f4ea6005ac131fdcfc82f26542d321a89d70..5bebd09b15b16222b941e7ed8f1b3d690e86496e 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-10  Ivan Shmakov  <ivan@siamics.net>
+
+       * net/shr.el (shr-urlify): Decode URLs before using them as titles
+       (bug#19555).
+
 2015-01-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * net/eww.el (eww): Always interpret URLs that start with https?:
index ed824cf3fb227e10c498a4dfd4f1428694e47100..a2bad81ee44e72e1f9f05e30b114975be5427cc7 100644 (file)
@@ -894,7 +894,13 @@ START, and END.  Note that START and END should be markers."
   (add-text-properties
    start (point)
    (list 'shr-url url
-        'help-echo (if title (shr-fold-text (format "%s (%s)" url title)) url)
+        'help-echo (let ((iri (or (with-demoted-errors
+                                      "shr-urlify: %s"
+                                    (decode-coding-string
+                                     (url-unhex-string url)
+                                     'utf-8 t))
+                                  url)))
+                     (if title (format "%s (%s)" iri title) iri))
         'follow-link t
         'mouse-face 'highlight
         'keymap shr-map)))