emacs-diffs
[Top][All Lists]
Advanced

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

master b572308: eww: don't add keymap to <a> without href


From: Andreas Schwab
Subject: master b572308: eww: don't add keymap to <a> without href
Date: Thu, 22 Oct 2020 14:14:06 -0400 (EDT)

branch: master
commit b572308fbf095da3bd7382d3b1c8f952a51ce3ac
Author: Andreas Schwab <schwab@linux-m68k.org>
Commit: Andreas Schwab <schwab@linux-m68k.org>

    eww: don't add keymap to <a> 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 fd9fe98..53835bb 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)



reply via email to

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