From: Lars Magne Ingebrigtsen Date: Fri, 10 Sep 2010 00:07:33 +0000 (+0000) Subject: gnus-html.el (gnus-html-wash-tags): Refactor out the image bit, and don't restrict... X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~48^2~20 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=698ecd82508a27e23eec06a3113bbfeafb8d8b4c;p=emacs.git gnus-html.el (gnus-html-wash-tags): Refactor out the image bit, and don't restrict end-tag searches to the end of the line. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index d810df8c7e9..28bbcc341ea 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2010-09-09 Lars Magne Ingebrigtsen + + * gnus-html.el (gnus-html-wash-tags): Refactor out the image bit, and + don't restrict end-tag searches to the end of the line. + 2010-09-09 Katsumi Yamaoka * gnus-start.el (gnus-get-unread-articles): Set the number of unread diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el index 03089414e3f..8bfbaaa5279 100644 --- a/lisp/gnus/gnus-html.el +++ b/lisp/gnus/gnus-html.el @@ -128,11 +128,9 @@ fit these criteria." (while (re-search-forward "]+>" nil t) (replace-match "" t t))) -(defun gnus-html-wash-tags () +(defun gnus-html-wash-images () (let (tag parameters string start end images url) - (gnus-html-pre-wash) (goto-char (point-min)) - ;; Search for all the images first. (while (re-search-forward "]*\\)>" nil t) (setq parameters (match-string 1) @@ -210,6 +208,13 @@ fit these criteria." (set-marker (make-marker) start) (point-marker)) images)))))))) + (when images + (gnus-html-schedule-image-fetching (current-buffer) (nreverse images))))) + +(defun gnus-html-wash-tags () + (let (tag parameters string start end images url) + (gnus-html-pre-wash) + (gnus-html-wash-images) (goto-char (point-min)) ;; Then do the other tags. @@ -220,7 +225,7 @@ fit these criteria." (when (plusp (length parameters)) (set-text-properties 0 (1- (length parameters)) nil parameters)) (delete-region start (point)) - (when (search-forward (concat "") (line-end-position) t) + (when (search-forward (concat "") nil t) (delete-region (match-beginning 0) (match-end 0))) (setq end (point)) (cond @@ -254,8 +259,6 @@ fit these criteria." ;; off any s that were left over. (while (re-search-forward "\\|" nil t) (replace-match "" t t)) - (when images - (gnus-html-schedule-image-fetching (current-buffer) (nreverse images))) (mm-url-decode-entities))) (defun gnus-html-insert-image ()