mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Make shr mark links with suspicious URLs
* lisp/international/textsec-check.el (textsec-propertize): New function. (textsec-check): Only check, don't alter STRING. * lisp/international/textsec.el (textsec-url-suspicious-p): New function. * lisp/net/shr.el (shr-tag-a): Mark suspicious links.
This commit is contained in:
parent
00a6946283
commit
1bfc086391
4 changed files with 41 additions and 13 deletions
|
|
@ -1467,7 +1467,12 @@ ones, in case fg and bg are nil."
|
|||
(dom-attr dom 'name)))) ; Obsolete since HTML5.
|
||||
(push (cons id (point)) shr--link-targets))
|
||||
(when url
|
||||
(shr-urlify (or shr-start start) (shr-expand-url url) title))))
|
||||
(shr-urlify (or shr-start start) (shr-expand-url url) title)
|
||||
(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 "⚠️")))))
|
||||
|
||||
(defun shr-tag-abbr (dom)
|
||||
(let ((title (dom-attr dom 'title))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue