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: Fri, 20 Dec 2013 13:20:47 +0000
Package:  emacs
Severity: wishlist

	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.  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.

	Also to note is that both the <font /> element and the ‘bgcolor’
	and ‘text’ attributes to <body /> were already deprecated as of
	HTML 4.01 (developed back in 1997–1999 – some 15 years ago! and
	the specification doesn’t seem to mention ‘fgcolor’ at all) [2],
	and are entirely removed as of the latest HTML5 CR [3].

	My guess is that there should be a (customizable) variable
	specifying whether these attributes should be honored by
	default, and a command (or a minor mode?) to change the setting
	for just the current buffer.

	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:

(eval-after-load 'shr
  '(progn
     (defun shr-tag-body (cont)
       (let ((shr-stylesheet (list)))
	 (shr-generic cont)))
     (defun shr-tag-font (cont)
       (shr-generic cont))))

[1] http://www.gnu.org/software/emacs/manual/html_node/gnus/Article-Washing.html
[2] http://www.w3.org/TR/html4/
[3] http://www.w3.org/TR/html5/

-- 
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.