diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-05-26 08:51:17 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-05-26 08:51:17 +0200 |
commit | 37e51051dc74506fdbda93cfb7046d855ce235c9 (patch) | |
tree | aae6709a749518ffe3ff585517c52257f3e7ecbf | |
parent | 281c00c1102fd116675b35680a293f312a61f530 (diff) |
extract-userhandle-from-url: check for url-filename
i ran into a "handle" that was just a TLD link. if we don't error when
url-filename is "", and just do nothing, SHR seems to render such a handle fine.
-rw-r--r-- | lisp/mastodon-tl.el | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index ae87532..c791f7e 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -863,6 +863,8 @@ this should be of the form <at-sign><user id>, e.g. \"@Gargon\"." (url-host (url-generic-parse-url mastodon-instance-url)) (url-host parsed-url)))) (when (and (string= "@" (substring buffer-text 0 1)) + ;; don't error on domain only url (rare): + (not (string= "" (url-filename parsed-url))) (string= (downcase buffer-text) (downcase (substring (url-filename parsed-url) 1)))) (if local-p |