GNU bug report logs - #16200
shr should allow user to toggle HTML-specified colors on and off

Previous Next

Package: emacs;

Reported by: Ivan Shmakov <ivan <at> siamics.net>

Date: Fri, 20 Dec 2013 13:22:02 UTC

Severity: wishlist

Tags: fixed

Fixed in version 26.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ivan Shmakov <ivan <at> siamics.net>
To: 16200 <at> debbugs.gnu.org
Subject: bug#16200: shr should allow user to toggle HTML-specified colors on and off 
Date: Thu, 03 Apr 2014 08:37:09 +0000
>>>>> Ivan Shmakov <ivan <at> siamics.net> writes:

 > Badly-formatted netnews articles aren’t unknown in Usenet, so Gnus
 > already comes with a set of commands [1] to improve the formatting of
 > the messages as they’re shown to the user.

 > I’d argue, however, that ugly HTML documents are much more common on
 > the Web than such articles are on Usenet.  Granted, shr.el does not
 > (as of yet) support a good deal of features casually used to degrade
 > the reader’s experience.

	(Such as, for instance, font-size:, especially when combined
	with a non-‘auto’ width:.)

 > Still, it supports the ‘fgcolor’, ‘text’ and ‘bgcolor’ attributes to
 > <body />, and the ‘color’ attribute to <font />, leaving the user no
 > easy way to get rid of whatever color scheme the Web page author has
 > decided to use.

	And, well, it also supports the color-related CSS properties, at
	least those specified via the ‘style’ HTML attribute.

[…]

 > As a crude (but working) workaround, those suffering of the “too much
 > color” problem may choose to redefine the shr-tag-body and
 > shr-tag-font element handlers to simplistic wrappers around
 > shr-generic in their ~/.emacs, like:

[…]

	I stand corrected: this workaround does not help with the CSS
	(‘style’ attribute) color settings.  Redefining
	shr-colorize-region to a no-op, however, seems to work:

(eval-after-load 'shr
  '(defun shr-colorize-region (start end fg &optional bg)
     nil))

	A proper solution would probably be to allow for a custom
	initial stylesheet, along with a proper cascading implementation
	(including the ‘!important’ flag handling), so that the user
	could both specify the default appearance, /and/ override the
	explicit styles as set by the HTML document being rendered.

 > [1] http://www.gnu.org/software/emacs/manual/html_node/gnus/Article-Washing.html

[…]

-- 
FSF associate member #7257




This bug report was last modified 8 years and 230 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.