Fix up TD background colours when doing the vertical padding.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 1 Feb 2011 02:58:16 +0000 (18:58 -0800)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 1 Feb 2011 02:58:16 +0000 (18:58 -0800)
lisp/ChangeLog
lisp/shr.el

index b74c99a..414175e 100644 (file)
@@ -2,6 +2,8 @@
 
        * shr.el (shr-render-td): Only do colours at the final rendering.
        Should be slightly faster.
+       (shr-insert-table): Fix up TD background colours when doing the
+       vertical padding.
 
        * gnus-art.el (article-date-ut): Protect against articles with no Date
        header.
index 715c220..10e04a8 100644 (file)
@@ -1055,8 +1055,11 @@ ones, in case fg and bg are nil."
          ;; possibly.
          (dotimes (i (- height (length lines)))
            (end-of-line)
-           (insert (make-string (string-width (car lines)) ? )
-                   shr-table-vertical-line)
+           (let ((start (point)))
+             (insert (make-string (string-width (car lines)) ? )
+                     shr-table-vertical-line)
+             (when (nth 4 column)
+               (shr-put-color start (1- (point)) :background (nth 4 column))))
            (forward-line 1)))))
     (shr-insert-table-ruler widths)))
 
@@ -1183,7 +1186,8 @@ ones, in case fg and bg are nil."
            (list max
                  (count-lines (point-min) (point-max))
                  (split-string (buffer-string) "\n")
-                 (shr-collect-overlays))
+                 (shr-collect-overlays)
+                 (cdr (assq 'background-color shr-stylesheet)))
          (list max
                (shr-natural-width)))))))