2010-10-29 Lars Magne Ingebrigtsen <larsi@gnus.org>
+ * shr.el (shr-table-depth): New variable.
+ (shr-tag-table-1): Only insert the images after the top-level table.
+
* nnimap.el (nnimap-split-incoming-mail): Fix typo.
* gnus-util.el (gnus-list-memq-of-list): New function.
(defvar shr-list-mode nil)
(defvar shr-content-cache nil)
(defvar shr-kinsoku-shorten nil)
+(defvar shr-table-depth 0)
(defvar shr-map
(let ((map (make-sparse-keymap)))
(setq cont (or (cdr (assq 'tbody cont))
cont))
(let* ((shr-inhibit-images t)
+ (shr-table-depth (1+ shr-table-depth))
(shr-kinsoku-shorten t)
;; Find all suggested widths.
(columns (shr-column-specs cont))
;; Finally, insert all the images after the table. The Emacs buffer
;; model isn't strong enough to allow us to put the images actually
;; into the tables.
- (dolist (elem (shr-find-elements cont 'img))
- (shr-tag-img (cdr elem))))
+ (when (zerop shr-table-depth)
+ (dolist (elem (shr-find-elements cont 'img))
+ (shr-tag-img (cdr elem)))))
(defun shr-tag-table (cont)
(shr-ensure-paragraph)