emacs-diffs
[Top][All Lists]
Advanced

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

master 9e9d83482c: Don't overwrite the link text in shr-tag-a for suspic


From: Lars Ingebrigtsen
Subject: master 9e9d83482c: Don't overwrite the link text in shr-tag-a for suspicious URLs
Date: Wed, 19 Jan 2022 11:17:55 -0500 (EST)

branch: master
commit 9e9d83482c40f0e9b34cba8c3cffe42e6d0ba80e
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Don't overwrite the link text in shr-tag-a for suspicious URLs
    
    * lisp/net/shr.el (shr-tag-a): Tweak how the suspiciousness
    warning is handled.
---
 lisp/net/shr.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 3ace872474..c3950acd3d 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1468,11 +1468,11 @@ ones, in case fg and bg are nil."
       (push (cons id (point)) shr--link-targets))
     (when url
       (shr-urlify (or shr-start start) (shr-expand-url url) title)
+      ;; Check whether the URL is suspicious.
       (when-let ((warning (textsec-check (shr-expand-url url) 'url)))
         (add-text-properties (or shr-start start) (point)
-                             (list 'help-echo warning
-                                   'face '(shr-link textsec-suspicious)))
-        (insert "⚠️")))))
+                             (list 'face '(shr-link textsec-suspicious)))
+        (insert (propertize "⚠️" 'help-echo warning))))))
 
 (defun shr-tag-abbr (dom)
   (let ((title (dom-attr dom 'title))



reply via email to

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