From 7e6ce097f0b39ce9af188578cd6417c74f2171d0 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Mon, 6 Dec 2010 18:25:46 +0100 Subject: [PATCH] (shr-tag-font): Get the background color right. --- lisp/ChangeLog | 1 + lisp/shr.el | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6cda9494b..7a30fca07 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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. diff --git a/lisp/shr.el b/lisp/shr.el index 8434d0b66..a41ebf11b 100644 --- a/lisp/shr.el +++ b/lisp/shr.el @@ -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. -- 2.11.4.GIT