From: Lars Magne Ingebrigtsen <larsi@gnus.org>
To: ding@gnus.org
Subject: Re: [gnus git] branch master updated: =2= shr: colorize only in one place ; shr: shr-colorize-region fix and stylesheet color retrieval fix
Date: Mon, 06 Dec 2010 17:00:39 +0100 [thread overview]
Message-ID: <m38w02yjq0.fsf@quimbies.gnus.org> (raw)
In-Reply-To: <sa3bp4yew25.fsf@cigue.easter-eggs.fr>
Julien Danjou <julien@danjou.info> writes:
> In that example yes. But with:
>
> <p style="background-color: red">foo<p style="color: red">bar<p>zot
>
> The result should be quite different.
>
> With the previous code, you would:
> - Insert `foo'
> - Insert `bar'
> - Paint `bar' in red
> - Insert zot
> - Paint the backgruond for foobarzot in red.
>
> bar was invisible: red on red. The color checker had no clue that the
> background was red.
Are you sure? Since it inherited the background-color from the parent,
it should have used it when it rendered the bar. So that you didn't get
red-on-red.
Let's see... yup:
(when (and style
(string-match "color" style))
(setq shr-stylesheet (nconc (shr-parse-style style)
shr-stylesheet)))
We add our stuff to what our parent(s) had...
[...]
(let ((color (cdr (assq 'color shr-stylesheet)))
(background (cdr (assq 'background-color
shr-stylesheet))))
(when (and shr-stylesheet
(or color background))
(shr-colorize-region start (point) color background)))))
... and then use it.
Should work, I think. Well, actually, it's rendering things too much --
it should have a (and (string-match "color" style)) in there, too,
probably.
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
next prev parent reply other threads:[~2010-12-06 16:00 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1PPcjn-0002Xs-00@quimby.gnus.org>
2010-12-06 15:24 ` Lars Magne Ingebrigtsen
2010-12-06 15:26 ` Lars Magne Ingebrigtsen
2010-12-06 15:54 ` Julien Danjou
2010-12-06 16:00 ` Lars Magne Ingebrigtsen [this message]
2010-12-06 16:03 ` Lars Magne Ingebrigtsen
2010-12-06 16:18 ` Julien Danjou
2010-12-06 16:25 ` Lars Magne Ingebrigtsen
2010-12-06 16:36 ` Julien Danjou
2010-12-06 16:41 ` Lars Magne Ingebrigtsen
2010-12-06 16:55 ` Lars Magne Ingebrigtsen
2010-12-06 17:32 ` colourising newlines (was: [gnus git] branch master updated: =2= shr: colorize only in one place ; shr: shr-colorize-region fix and stylesheet color retrieval fix) Lars Magne Ingebrigtsen
2010-12-14 23:51 ` colourising newlines Ted Zlatanov
2010-12-15 19:30 ` Lars Magne Ingebrigtsen
2010-12-15 21:03 ` Ted Zlatanov
2010-12-15 21:30 ` Lars Magne Ingebrigtsen
2010-12-15 21:40 ` Ted Zlatanov
2010-12-16 15:54 ` Lars Magne Ingebrigtsen
2010-12-16 20:43 ` Ted Zlatanov
2010-12-16 20:25 ` Eric S Fraga
2010-12-17 16:43 ` Lars Magne Ingebrigtsen
2010-12-18 19:20 ` Eric S Fraga
2011-01-19 22:24 ` Ted Zlatanov
2011-01-22 3:02 ` Lars Ingebrigtsen
2011-01-24 19:46 ` Ted Zlatanov
2010-12-06 16:17 ` [gnus git] branch master updated: =2= shr: colorize only in one place ; shr: shr-colorize-region fix and stylesheet color retrieval fix Julien Danjou
2010-12-06 16:22 ` Lars Magne Ingebrigtsen
2010-12-06 16:27 ` Lars Magne Ingebrigtsen
2010-12-06 16:48 ` Julien Danjou
2010-12-06 17:26 ` Lars Magne Ingebrigtsen
2010-12-06 17:30 ` Julien Danjou
2010-12-06 17:33 ` Lars Magne Ingebrigtsen
2010-12-06 16:33 ` Julien Danjou
2010-12-06 16:36 ` Lars Magne Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m38w02yjq0.fsf@quimbies.gnus.org \
--to=larsi@gnus.org \
--cc=ding@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).