;;; Code:
(eval-when-compile (require 'cl))
-(eval-when-compile (require 'mm-decode))
(require 'gnus-art)
+(eval-when-compile (require 'mm-decode))
+
(require 'mm-url)
(require 'url)
(require 'url-cache)
(let ((alt-text (when (string-match "\\(alt\\|title\\)=\"\\([^\"]+\\)"
parameters)
(xml-substitute-special (match-string 2 parameters)))))
- (gnus-put-text-property start end 'gnus-image-url url)
+ (gnus-put-text-property start end 'image-url url)
(if (gnus-html-image-url-blocked-p
url
(if (buffer-live-p gnus-summary-buffer)
(defun gnus-html-browse-image ()
"Browse the image under point."
(interactive)
- (browse-url (get-text-property (point) 'gnus-image-url)))
+ (browse-url (get-text-property (point) 'image-url)))
(defun gnus-html-browse-url ()
"Browse the image under point."
(interactive)
(let ((url (get-text-property (point) 'gnus-string)))
- (if (not url)
- (message "No URL at point")
- (browse-url url))))
+ (cond
+ ((not url)
+ (message "No link under point"))
+ ((string-match "^mailto:" url)
+ (gnus-url-mailto url))
+ (t
+ (browse-url url)))))
(defun gnus-html-schedule-image-fetching (buffer image)
"Retrieve IMAGE, and place it into BUFFER on arrival."
"Put an image with DATA from URL and optional ALT-TEXT."
(when (gnus-graphic-display-p)
(let* ((start (text-property-any (point-min) (point-max)
- 'gnus-image-url url))
+ 'image-url url))
(end (when start
- (next-single-property-change start 'gnus-image-url))))
+ (next-single-property-change start 'image-url))))
;; Image found?
(when start
(let* ((image
'gnus-alt-text alt-text)
(when url
(gnus-put-text-property start (point)
- 'gnus-image-url url))
+ 'image-url url))
(gnus-add-image 'external image)
t)
;; Bad image, try to show something else
(let ((blocked-images (with-current-buffer summary
(gnus-blocked-images))))
(save-match-data
- (while (re-search-forward "<img[^>]+src=[\"']\\([^\"']+\\)" nil t)
- (let ((url (gnus-html-encode-url (match-string 1))))
+ (while (re-search-forward "<img[^>]+src=[\"']\\(http[^\"']+\\)" nil t)
+ (let ((url (gnus-html-encode-url
+ (mm-url-decode-entities-string (match-string 1)))))
(unless (gnus-html-image-url-blocked-p url blocked-images)
(when (gnus-html-cache-expired url gnus-html-image-cache-ttl)
(gnus-html-schedule-image-fetching nil