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

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

bug#39504: 27.0.60; [PATCH] eww/shr: Ensure faces of enclosing elements


From: Kévin Le Gouguec
Subject: bug#39504: 27.0.60; [PATCH] eww/shr: Ensure faces of enclosing elements apply to <code> elements
Date: Sat, 08 Feb 2020 01:06:11 +0100

Hello!

I have a minor gripe with the way eww/shr render <code> elements within
other inline elements.  My main frustration stems from code inside
links[1], but this extends to other elements, e.g. <strong> and <em>:

Variable fixed variable

Variable fixed variable

Variable fixed variable

Variable fixed variable

Here is how Emacs 26.3 rendered it:

Attachment: emacs-26.png
Description: PNG image

Here is how Emacs 27 and 28 render it:

Attachment: emacs-27.png
Description: PNG image

Both Emacs variants fail to do what I'd expect:

- Emacs 26 uses variable-pitch for <code> elements,
- Emacs 27+ uses the default face, which does ensure a monospace font,
  but also neutralizes any effects of enclosing elements, e.g.
    - no bold inside <strong>,
    - no italics inside <em>,
    - no blue color nor underline inside <a>.

For example, here is how Firefox 72 does it:

Attachment: firefox-72.png
Description: PNG image

Here is a first, simple patch that uses fixed-pitch instead of default
to ensure other face attributes are not overridden:

Attachment: patch1.patch
Description: Text Data

Here is an alternative patch which allows customizing the face used for
<code>, in case the user wants e.g. fixed-pitch-serif instead of
fixed-pitch:

Attachment: patch2.patch
Description: Text Data

Both patches give the same results:

Attachment: patch.png
Description: PNG image

If the second patch seems like a worthwhile addition, I can augment it
with some documentation.


Thank you for your time.


[1] Cf. for example This Week In Rust:
    
https://this-week-in-rust.org/blog/2020/02/04/this-week-in-rust-324/#updates-from-rust-core


In GNU Emacs 28.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, cairo 
version 1.16.0)
 of 2020-01-31 built on hirondell
Repository revision: d3ead375092e2690c1d1d6a5dd82e6e89cdf4f4c
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)

Configured using:
 'configure --with-xwidgets --with-cairo'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS
LIBSYSTEMD JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

reply via email to

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