From b4e64499e2a9364d26857e6b989172078dbefcb7 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 22 Sep 2010 12:14:12 +0000 Subject: [PATCH] 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. --- lisp/gnus/ChangeLog | 6 ++++++ lisp/gnus/gnus-html.el | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index c0651267d25..8851f19ed8d 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,9 @@ +2010-09-22 Julien Danjou + + * 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 * mailcap.el (mailcap-parse-mailcap, mailcap-parse-mimetypes) diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el index 34dbb4dd878..366c331c594 100644 --- a/lisp/gnus/gnus-html.el +++ b/lisp/gnus/gnus-html.el @@ -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 @@ fit these criteria." ;; 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 @@ Return a string with image data." (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) -- 2.39.5