[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 37e2304f98 2/2: Tweak textsec-link-suspicious-p
From: |
Lars Ingebrigtsen |
Subject: |
master 37e2304f98 2/2: Tweak textsec-link-suspicious-p |
Date: |
Thu, 20 Jan 2022 04:10:16 -0500 (EST) |
branch: master
commit 37e2304f98fac44fd146ea34c499764a95a9bb6e
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Tweak textsec-link-suspicious-p
* lisp/international/textsec.el (textsec-link-suspicious-p): Don't
mark dates as suspicious.
---
lisp/international/textsec.el | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/lisp/international/textsec.el b/lisp/international/textsec.el
index ad3b59c315..ba39c44e85 100644
--- a/lisp/international/textsec.el
+++ b/lisp/international/textsec.el
@@ -398,9 +398,13 @@ when the link text looks like an URL itself, but doesn't
lead to
the same domain as the URL."
(let* ((url (car link))
(text (string-trim (cdr link)))
- (text-bits (seq-filter (lambda (bit)
- (string-match-p "\\`[^.]+\\.[^.]+.*\\'" bit))
- (split-string text))))
+ (text-bits (seq-filter
+ (lambda (bit)
+ (and (string-match-p "\\`[^.]+\\.[^.]+.*\\'" bit)
+ ;; All-numerical texts are probably not
+ ;; suspicious (but what about IP addresses?).
+ (not (string-match-p "\\`[0-9.]+\\'" bit))))
+ (split-string text))))
(when text-bits
(setq text-bits (seq-map (lambda (string)
(if (not (string-match-p "\\`[^:]+:" string))