From: Lars Ingebrigtsen Date: Wed, 19 Jan 2022 16:17:42 +0000 (+0100) Subject: Don't overwrite the link text in shr-tag-a for suspicious URLs X-Git-Tag: emacs-29.0.90~2936 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9e9d83482c40f0e9b34cba8c3cffe42e6d0ba80e;p=emacs.git 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. --- 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))