(shr-tag-font): Get the background color right.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 6 Dec 2010 17:25:46 +0000 (18:25 +0100)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 6 Dec 2010 17:25:46 +0000 (18:25 +0100)
lisp/ChangeLog
lisp/shr.el

index 6cda949..7a30fca 100644 (file)
@@ -4,6 +4,7 @@
        (shr-tag-body): Ditto.
        (shr-tag-font): Actually let the styles be inherited instead of
        overwriting them.
+       (shr-tag-font): Get the background color right.
 
        * gnus-int.el (gnus-request-thread): Rework to take a header instead of
        a Message-ID to avoid having nnimap depend on gnus-sum.
index 8434d0b..a41ebf1 100644 (file)
@@ -202,12 +202,11 @@ redirects somewhere else."
     (if (fboundp function)
        (funcall function (cdr dom))
       (shr-generic (cdr dom)))
-    (let ((color (cdr (assq 'color shr-stylesheet)))
-         (background (cdr (assq 'background-color shr-stylesheet))))
-      (when (and style
-                shr-stylesheet
-                (or color background))
-       (shr-colorize-region start (point) color background)))))
+    ;; If style is set, then this node has set the color.
+    (when style
+      (shr-colorize-region start (point)
+                          (cdr (assq 'color shr-stylesheet))
+                          (cdr (assq 'background-color shr-stylesheet))))))
 
 (defun shr-generic (cont)
   (dolist (sub cont)
@@ -843,7 +842,9 @@ ones, in case fg and bg are nil."
          (shr-stylesheet (nconc (list (cons 'color color))
                                shr-stylesheet)))
     (shr-generic cont)
-    (shr-colorize-region start (point) color nil)))
+    (when color
+      (shr-colorize-region start (point) color
+                          (cdr (assq 'background-color shr-stylesheet))))))
 
 ;;; Table rendering algorithm.