GNU bug report logs - #49433
28.0.50; Faulty list of faces in shr-tag-h1

Previous Next

Package: emacs;

Reported by: Protesilaos Stavrou <info <at> protesilaos.com>

Date: Tue, 6 Jul 2021 07:38:01 UTC

Severity: normal

Found in version 28.0.50

Fixed in version 28.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: Protesilaos Stavrou <info <at> protesilaos.com>
To: 49433 <at> debbugs.gnu.org
Subject: bug#49433: 28.0.50; Faulty list of faces in shr-tag-h1
Date: Tue, 06 Jul 2021 10:37:12 +0300
In 'shr.el' we find these:

    (defun shr-tag-h1 (dom)
      (shr-heading dom (if shr-use-fonts
                   '(variable-pitch (:height 1.3 :weight bold))
                 'bold)))

    (defun shr-tag-h2 (dom)
      (shr-heading dom 'bold))

The intent is to make h1 headings use 'variable-pitch', however this
happens regardless, as can be noticed in other headings, such as h2 for
rendered documents.  As such, 'shr-tag-h1' creates duplication of the
'variable-pitch' entry.

Steps to reproduce on emacs -Q:

+ M-x eww RET https://www.gnu.org/software/emacs/

+ Go to the h1 heading that reads "GNU Emacs".

+ M-x describe-char

+ In the resulting Help buffer, notice this:

    (variable-pitch (variable-pitch (:height 1.3 :weight bold)))

+ The button that references that anonymous face does not provide a Help
  buffer with accurate information as to what attributes are in effect.
  Instead, it only lists the attributes of 'variable-pitch'.

+ Compare that to the information we get from the next heading, "An
  extensible, customizable, free/libre text editor — and more.", which
  accurately shows both of the faces that are in effect.

To fix the issue, we need to pass a face directly, without combining it
with 'variable-pitch'.  Just like 'shr-tag-h2'.  In a separate report, I
provide a patch that does that and adds new faces for all heading
elements (using 'defface' instead of hardcoding values).

Thank you!

-- 
Protesilaos Stavrou
https://protesilaos.com

This bug report was last modified 3 years and 321 days ago.

Previous Next


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