From 083b504626fa3540cc7e88a8288b30b9ee7292bc Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 12 Sep 2022 14:06:59 +0200 Subject: improve masto-url-p regexes for users --- lisp/mastodon.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp/mastodon.el') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 5e95b35..969ab36 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -305,10 +305,12 @@ not, just browse the URL in the normal fashion." (defun mastodon--masto-url-p (query) "Check if QUERY resembles a fediverse URL." ;; calqued off https://github.com/tuskyapp/Tusky/blob/c8fc2418b8f5458a817bba221d025b822225e130/app/src/main/java/com/keylesspalace/tusky/BottomSheetActivity.kt + ;; thx to Conny Duck! (let* ((uri-parsed (url-generic-parse-url query)) (query (url-filename uri-parsed))) (save-match-data - (or (string-match "^/@[[:alnum:]]+/[[:digit:]]+$" query) + (or (string-match "^/@[^/]+$" query) + (string-match "^/@[^/]+/[[:digit:]]+$" query) (string-match "^/users/[[:alnum:]]+$" query) (string-match "^/notice/[[:alnum:]]+$" query) (string-match "^/objects/[-a-f0-9]+$" query) -- cgit v1.2.3