Subject: bug#78948: closed (Re: bug#78948: [PATCH] Retain the <base> tag when making a page in EWW document readable)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 04 Jul 2025 04:06:02 +0000

Your bug report

#78948: [PATCH] Retain the <base> tag when making a page in EWW document readable

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
78948: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78948
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#78948: [PATCH] Retain the <base> tag when making a page in EWW document readable
From: Jim Porter <[email-masked]>
To: Steven Allen <[email-masked]>, Eli Zaretskii <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Thu, 3 Jul 2025 21:04:52 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

On 7/3/2025 8:18 AM, Steven Allen via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> Good point, see attached.

Thanks. This all looks good to me, so I've merged it to the master 
branch as f10bf71151b. (I hope... I got an error while pushing, but I 
think everything's in sync. I guess Savannah's under attack again.)

Subject: [PATCH] Retain the <base> tag when making a page in EWW document readable
From: Steven Allen <[email-masked]>
To: [email-masked]
Date: Wed, 02 Jul 2025 14:37:27 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

Retain the <base> tag when making a page in EWW document
readable. Otherwise, relative links aren't resolved correctly.

In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, cairo version
 1.18.4) of 2025-07-02 built on Laptop
Repository revision: bf7d9f3c47ee59d45129d08490411e572a737db5
Repository branch: makepkg
Windowing system distributor 'The X.Org Foundation', version 11.0.12101018
System Description: Arch Linux

Configured using:
 'configure
 'CPPFLAGS=-I/run/user/1000/build/emacs-git/src/mps-git/build/include '
 'LDFLAGS=-L/run/user/1000/build/emacs-git/src/mps-git/build/lib -Wl,-O1
 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now
 -Wl,-z,pack-relative-relocs -flto=auto' --prefix=/usr --sysconfdir=/etc
 --libexecdir=/usr/lib --localstatedir=/var --mandir=/usr/share/man
 --with-gameuser=:games --with-modules --without-m17n-flt
 --without-selinux --without-pop --without-gconf --disable-gc-mark-trace
 --with-mps=yes --enable-link-time-optimization
 --with-native-compilation=yes --with-xinput2 --with-x-toolkit=no
 --without-toolkit-scroll-bars --without-xaw3d --without-gsettings
 --with-cairo-xcb --without-xft --with-sound=no --with-tree-sitter
 --without-gpm --without-compress-install
 '--program-transform-name=s/\([ec]tags\)/\1.emacs/'
 'CFLAGS=-march=native -mtune=native -O3 -pipe -fno-plt -fexceptions
 -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security
 -fstack-clash-protection -fcf-protection -fomit-frame-pointer
 -fno-math-errno -fno-trapping-math -fno-math-errno -fno-trapping-math
 -flto=auto''

>From a681cc767b1124bed84432ebb062f110383ede68 Mon Sep 17 00:00:00 2001
From: Steven Allen <[email-masked]>
Date: Wed, 2 Jul 2025 14:32:28 -0700
Subject: [PATCH] Retain the <base> tag when making a page in EWW document
 readable

The base tag is necessary to correctly resolve relative links.

* lisp/net/eww.el (eww-readable-dom): Retain the base tag in addition to
the title/link tags.
---
 lisp/net/eww.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 2f99234c47d..76dccaec9dd 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1225,7 +1225,7 @@ eww-readable-dom
          ;; "previous" pages.  NOTE: We could probably filter out
          ;; stylesheet <link> tags here, though it doesn't really matter
          ;; since we don't *do* anything with stylesheets...
-         (when (memq (dom-tag node) '(title link))
+         (when (memq (dom-tag node) '(title link base))
            ;; Copy the node, but not any of its (non-text) children.
            ;; This way, we can ensure that we don't include a node
            ;; directly in our list in addition to as a child of some
-- 
2.50.0