From 9e9d83482c40f0e9b34cba8c3cffe42e6d0ba80e Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 19 Jan 2022 17:17:42 +0100 Subject: [PATCH] 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 3ace872474c..c3950acd3d8 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)) -- 2.39.2