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

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

bug#40532: 28.0.50; eww/shr: Anchor link does not work


From: Basil L. Contovounesios
Subject: bug#40532: 28.0.50; eww/shr: Anchor link does not work
Date: Wed, 22 Apr 2020 13:55:05 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> Indeed; I think it's a regression in Emacs 27 caused by the following
> fix for bug#28441:
>
> Make #anchors work again in eww
> fa41693799 2018-04-13 14:55:55 +0200
> https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=fa416937997a113d84ab4e4910d730ce5d77613d
>
> Previously, eww-follow-link depended on eww-display-html to set
> shr-target-id, but following this change that's no longer the case.
>
> This doesn't affect eww-reload, which also calls eww-display-html,
> because it passes it an explicit position to jump to.

[...]

> Lars, Eli, how's the following fix for emacs-27?

Here's an even better fix for the regression IMO:

>From 541a85fd17193a67883a36876fb982710abe4f7d Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@tcd.ie>
Date: Wed, 22 Apr 2020 11:42:17 +0100
Subject: [PATCH] Fix eww-follow-link on URLs with #target

* lisp/net/eww.el (eww-display-html): Ensure shr-target-id is set as
callers depend on this (bug#28441, bug#40532).
---
 lisp/net/eww.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index c83884fd25..1be499172b 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -518,6 +518,10 @@ eww-display-html
       (plist-put eww-data :dom document)
       (let ((inhibit-read-only t)
            (inhibit-modification-hooks t)
+            ;; Possibly set by the caller, e.g., `eww-render' which
+            ;; preserves the old URL #target before chasing redirects.
+            (shr-target-id (or shr-target-id
+                               (url-target (url-generic-parse-url url))))
            (shr-external-rendering-functions
              (append
               shr-external-rendering-functions
-- 
2.26.1

WDYT?

-- 
Basil

reply via email to

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