bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#16200: shr should allow user to toggle HTML-specified colors on and


From: Ivan Shmakov
Subject: bug#16200: shr should allow user to toggle HTML-specified colors on and off
Date: Thu, 03 Apr 2014 08:37:09 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

>>>>> Ivan Shmakov <address@hidden> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]