]> git.eshelyaron.com Git - emacs.git/commitdiff
eww: don't add keymap to <a> without href
authorAndreas Schwab <schwab@linux-m68k.org>
Thu, 22 Oct 2020 18:07:24 +0000 (20:07 +0200)
committerAndreas Schwab <schwab@linux-m68k.org>
Thu, 22 Oct 2020 18:13:24 +0000 (20:13 +0200)
* lisp/net/eww.el (eww-tag-a): Only add keymap if the href
attribute is present.  (Bug#44147)

lisp/net/eww.el

index fd9fe98439da664bbbcfa85475766285eaa0b2d5..53835bb5440e4d3bf952893b7c2357c6f60ffe6e 100644 (file)
@@ -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)