2010-11-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
+ * gnus-html.el (gnus-html-wash-images): Register a displayer.
+
+ * gnus-util.el (gnus-find-text-property-region): Return markers.
+
* shr.el (shr-tag-img): Put a displayer in the text property.
* gnus-util.el (gnus-find-text-property-region): New utility function.
(let* ((handle (mm-get-content-id
(setq url (match-string 1 url))))
(image (when handle
- (gnus-create-image (mm-with-part handle (buffer-string))
- nil t))))
+ (gnus-create-image
+ (mm-with-part handle (buffer-string))
+ nil t))))
(when image
(let ((string (buffer-substring start end)))
(delete-region start end)
- (gnus-put-image (gnus-rescale-image image (gnus-html-maximum-image-size))
+ (gnus-put-image (gnus-rescale-image
+ image (gnus-html-maximum-image-size))
(gnus-string-or string "*") 'cid)
(gnus-add-image 'cid image))))
;; Normal, external URL.
- (let ((alt-text (when (string-match "\\(alt\\|title\\)=\"\\([^\"]+\\)"
- parameters)
- (xml-substitute-special (match-string 2 parameters)))))
+ (let ((alt-text
+ (when (string-match "\\(alt\\|title\\)=\"\\([^\"]+\\)"
+ parameters)
+ (xml-substitute-special (match-string 2 parameters)))))
(gnus-put-text-property start end 'image-url url)
+ (gnus-put-text-property
+ start end 'image-displayer
+ (lambda (url start end)
+ (gnus-html-display-image url start end)))
(if (gnus-html-image-url-blocked-p
url
(if (buffer-live-p gnus-summary-buffer)
(if (not end)
(setq start nil)
(when value
- (push (list start end value) regions))
+ (push (list (set-marker (make-marker) start)
+ (set-marker (make-marker) end)
+ value)
+ regions))
(setq start (next-single-property-change start prop))))
(nreverse regions)))