From: Lars Ingebrigtsen Date: Fri, 13 Apr 2018 12:55:55 +0000 (+0200) Subject: Make #anchors work again in eww X-Git-Tag: emacs-27.0.90~5257 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fa416937997a113d84ab4e4910d730ce5d77613d;p=emacs.git Make #anchors work again in eww * lisp/net/eww.el (eww-render): When we have a #link link, then url.el will say that we have a redirect to a non-#link link, so get the anchor before url.el mangles the URL (bug#28441). (eww-display-html): ... and don't get it here, because it's gone by now. Test URL: http://www.gnu.org/s/hyperbole/#summary --- diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 08a40cef182..6b7fa05ded5 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -349,9 +349,6 @@ Currently this means either text/html or application/xhtml+xml." "application/xhtml+xml"))) (defun eww-render (status url &optional point buffer encode) - (let ((redirect (plist-get status :redirect))) - (when redirect - (setq url redirect))) (let* ((headers (eww-parse-headers)) (content-type (mail-header-parse-content-type @@ -364,7 +361,11 @@ Currently this means either text/html or application/xhtml+xml." (eww-detect-charset (eww-html-p (car content-type))) "utf-8")))) (data-buffer (current-buffer)) + (shr-target-id (url-target (url-generic-parse-url url))) last-coding-system-used) + (let ((redirect (plist-get status :redirect))) + (when redirect + (setq url redirect))) (with-current-buffer buffer ;; Save the https peer status. (plist-put eww-data :peer (plist-get status :peer)) @@ -460,7 +461,6 @@ Currently this means either text/html or application/xhtml+xml." (plist-put eww-data :dom document) (let ((inhibit-read-only t) (inhibit-modification-hooks t) - (shr-target-id (url-target (url-generic-parse-url url))) (shr-external-rendering-functions (append shr-external-rendering-functions