unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16200: shr should allow user to toggle HTML-specified colors on and off
@ 2013-12-20 13:20 Ivan Shmakov
  2014-02-02  2:46 ` Nathan Trapuzzano
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ivan Shmakov @ 2013-12-20 13:20 UTC (permalink / raw)
  To: 16200

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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#16200: shr should allow user to toggle HTML-specified colors on and off
  2013-12-20 13:20 bug#16200: shr should allow user to toggle HTML-specified colors on and off Ivan Shmakov
@ 2014-02-02  2:46 ` Nathan Trapuzzano
  2014-04-03  8:37 ` Ivan Shmakov
  2014-11-14  3:30 ` Lars Magne Ingebrigtsen
  2 siblings, 0 replies; 5+ messages in thread
From: Nathan Trapuzzano @ 2014-02-02  2:46 UTC (permalink / raw)
  To: Ivan Shmakov; +Cc: 16200

Ivan Shmakov <ivan@siamics.net> writes:

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

I second this.  w3m knows that my Emacs frames have white text on a
black background and renders the pages accordingly, regardless of their
color settings.  An equivalent feature in shr would invite me to switch.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#16200: shr should allow user to toggle HTML-specified colors on and off
  2013-12-20 13:20 bug#16200: shr should allow user to toggle HTML-specified colors on and off Ivan Shmakov
  2014-02-02  2:46 ` Nathan Trapuzzano
@ 2014-04-03  8:37 ` Ivan Shmakov
  2014-11-14  3:30 ` Lars Magne Ingebrigtsen
  2 siblings, 0 replies; 5+ messages in thread
From: Ivan Shmakov @ 2014-04-03  8:37 UTC (permalink / raw)
  To: 16200

>>>>> Ivan Shmakov <ivan@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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#16200: shr should allow user to toggle HTML-specified colors on and off
  2013-12-20 13:20 bug#16200: shr should allow user to toggle HTML-specified colors on and off Ivan Shmakov
  2014-02-02  2:46 ` Nathan Trapuzzano
  2014-04-03  8:37 ` Ivan Shmakov
@ 2014-11-14  3:30 ` Lars Magne Ingebrigtsen
  2015-12-25 17:51   ` Lars Ingebrigtsen
  2 siblings, 1 reply; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 2014-11-14  3:30 UTC (permalink / raw)
  To: Ivan Shmakov; +Cc: 16200

See

http://permalink.gmane.org/gmane.emacs.devel/177000

and the preceding thread for some discussion on this

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#16200: shr should allow user to toggle HTML-specified colors on and off
  2014-11-14  3:30 ` Lars Magne Ingebrigtsen
@ 2015-12-25 17:51   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2015-12-25 17:51 UTC (permalink / raw)
  To: Ivan Shmakov; +Cc: 16200

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> http://permalink.gmane.org/gmane.emacs.devel/177000
>
> and the preceding thread for some discussion on this

I've now implemented a toggle in eww for colors.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-12-25 17:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-20 13:20 bug#16200: shr should allow user to toggle HTML-specified colors on and off Ivan Shmakov
2014-02-02  2:46 ` Nathan Trapuzzano
2014-04-03  8:37 ` Ivan Shmakov
2014-11-14  3:30 ` Lars Magne Ingebrigtsen
2015-12-25 17:51   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).