changeset 110477:f97b4d2abce9

gnus-html.el (gnus-html-wash-images): Use xml-substitute-special on images alt-text. gnus-html.el (gnus-html-put-image): Put alt-text as help-echo.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Wed, 22 Sep 2010 12:14:12 +0000
parents c25bd24799eb
children 1167c781dfa2
files lisp/gnus/ChangeLog lisp/gnus/gnus-html.el
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Wed Sep 22 11:45:26 2010 +0200
+++ b/lisp/gnus/ChangeLog	Wed Sep 22 12:14:12 2010 +0000
@@ -1,3 +1,9 @@
+2010-09-22  Julien Danjou  <julien@danjou.info>
+
+	* gnus-html.el (gnus-html-wash-images): Use xml-substitute-special on
+	images alt-text.
+	(gnus-html-put-image): Put alt-text as help-echo.
+
 2010-09-22  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* mailcap.el (mailcap-parse-mailcap, mailcap-parse-mimetypes)
--- a/lisp/gnus/gnus-html.el	Wed Sep 22 11:45:26 2010 +0200
+++ b/lisp/gnus/gnus-html.el	Wed Sep 22 12:14:12 2010 +0000
@@ -35,6 +35,7 @@
 (require 'mm-url)
 (require 'url)
 (require 'url-cache)
+(require 'xml)
 
 (defcustom gnus-html-image-cache-ttl (days-to-time 7)
   "Time in seconds used to cache the image on disk."
@@ -175,7 +176,7 @@
 	  ;; Normal, external URL.
           (let ((alt-text (when (string-match "\\(alt\\|title\\)=\"\\([^\"]+\\)"
                                               parameters)
-                            (match-string 2 parameters))))
+                            (xml-substitute-special (match-string 2 parameters)))))
             (if (gnus-html-image-url-blocked-p
                  url
                  (if (buffer-live-p gnus-summary-buffer)
@@ -403,6 +404,7 @@
               (let ((image (gnus-html-rescale-image image data size)))
                 (delete-region start end)
                 (gnus-put-image image alt-text 'external)
+                (gnus-put-text-property start (point) 'help-echo alt-text)
                 (gnus-overlay-put (gnus-make-overlay start (point)) 'local-map
                                   gnus-html-displayed-image-map)
                 (gnus-put-text-property start (point) 'gnus-alt-text alt-text)