summaryrefslogtreecommitdiff
path: root/lisp/net/shr.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-01-22 13:14:36 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2022-01-22 13:14:43 +0100
commita0e6e67ac16b1d73e50b2af014a8319e2afe76a2 (patch)
tree8be12ef869618bb34adb7473afea1132dee5f32b /lisp/net/shr.el
parent07f32fa70a219637f6872655ba46e5293e607df4 (diff)
downloademacs-a0e6e67ac16b1d73e50b2af014a8319e2afe76a2.tar.gz
Fix HTML target marking in shr
* lisp/net/shr.el (shr-descend): Use a marker (because we may be altering the text later for indentation), and mark the start, not the end of the tag (bug#53409). (shr-tag-a): Ditto.
Diffstat (limited to 'lisp/net/shr.el')
-rw-r--r--lisp/net/shr.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index ff14acfda70..6e0af06bed1 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -630,7 +630,7 @@ size, and full-buffer size."
(t
(shr-generic dom)))
(when-let ((id (dom-attr dom 'id)))
- (push (cons id (point)) shr--link-targets))
+ (push (cons id (set-marker (make-marker) start)) shr--link-targets))
;; If style is set, then this node has set the color.
(when style
(shr-colorize-region
@@ -1465,7 +1465,7 @@ ones, in case fg and bg are nil."
(shr-generic dom)
(when-let* ((id (and (not (dom-attr dom 'id)) ; Handled by `shr-descend'.
(dom-attr dom 'name)))) ; Obsolete since HTML5.
- (push (cons id (point)) shr--link-targets))
+ (push (cons id (set-marker (make-marker) start)) shr--link-targets))
(when url
(shr-urlify (or shr-start start) (shr-expand-url url) title)
;; Check whether the URL is suspicious.