On Mon, Dec 06 2010, Lars Magne Ingebrigtsen wrote: > It adds all the stuff from style="" to the (inherited) style sheet, so > if background-color is present, it's inherited. Yes, but you are forgetting about tag attributes like 'bgcolor': ^^^^ this one was NOT added to shr-stylesheet, that's what I am talking about. :) > If any parent had color/background-color, then shr-colorize-region will > be called with those colours. That's the optimisation problem: > > (let ((color (cdr (assq 'color shr-stylesheet))) > (background (cdr (assq 'background-color > shr-stylesheet)))) > > shr-stylesheet here isn't the style="" from the current tag, but the > inherited one (that includes the current tag, at this point). I understand, but somehow you have to give the parent's background color so if a children as a foreground color it can check the color. One thing what still does not work correctly though:
Foo la la la
dwq Bar
Zot
"dwq" will not be in red. That's because I think we are not calling shr-colorize at the right place. -- Julien Danjou // ᐰ http://julien.danjou.info