diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2022-09-12 14:06:59 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2022-09-12 14:06:59 +0200 |
commit | 083b504626fa3540cc7e88a8288b30b9ee7292bc (patch) | |
tree | 990c715b55b3e67b6cc6c75d45f4b27274a0364d /lisp | |
parent | c9e702448548daac323983ac2fa42522801da4aa (diff) |
improve masto-url-p regexes for users
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon.el | 4 |
1 files changed, 3 insertions, 1 deletions
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) |