From 37e51051dc74506fdbda93cfb7046d855ce235c9 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 26 May 2023 08:51:17 +0200 Subject: 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. --- lisp/mastodon-tl.el | 2 ++ 1 file changed, 2 insertions(+) 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 , 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 -- cgit v1.2.3