From b572308fbf095da3bd7382d3b1c8f952a51ce3ac Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Thu, 22 Oct 2020 20:07:24 +0200 Subject: [PATCH] eww: don't add keymap to without href * lisp/net/eww.el (eww-tag-a): Only add keymap if the href attribute is present. (Bug#44147) --- lisp/net/eww.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index fd9fe98439d..53835bb5440 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -695,11 +695,12 @@ Currently this means either text/html or application/xhtml+xml." (eww-handle-link dom) (let ((start (point))) (shr-tag-a dom) - (put-text-property start (point) - 'keymap - (if (mm-images-in-region-p start (point)) - eww-image-link-keymap - eww-link-keymap)))) + (if (dom-attr dom 'href) + (put-text-property start (point) + 'keymap + (if (mm-images-in-region-p start (point)) + eww-image-link-keymap + eww-link-keymap))))) (defun eww--limit-string-pixelwise (string pixels) (if (not pixels) -- 2.39.2