aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-10-14 13:26:29 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-10-14 13:27:26 +0200
commit652c17da292065d760d8ad455dba9dd26ac49ba1 (patch)
treea515ae840d8732843b93ebc8e0dddd0192d09974 /lisp/mastodon-tl.el
parent8b4d1cbf0727879e5cbeb2f8af985cea1683c771 (diff)
card authors tiny clean up. #596.
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index b32fe70..e2cba94 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -901,17 +901,18 @@ links in the text. If TOOT is nil no parsing occurs."
(defun mastodon-tl--insert-card-authors (authors)
"Insert a string of card AUTHORS."
- (insert
- (concat
- "\n(Authors: "
- (mapconcat #'mastodon-tl--format-card-author authors "\n")
- ")\n")))
+ (let ((authors-str (format "Author%s: "
+ (if (< 1 (length authors)) "s" ""))))
+ (insert
+ (concat
+ "\n(" authors-str
+ (mapconcat #'mastodon-tl--format-card-author authors "\n")
+ ")\n"))))
(defun mastodon-tl--format-card-author (data)
"Render card author DATA."
- ;; FIXME: update as needed, data contains "name" "url" and "account"
- (when (alist-get 'account data) ;.account
- (let-alist (alist-get 'account data) ;.account
+ (when-let ((account (alist-get 'account data))) ;.account
+ (let-alist account ;.account
;; FIXME: replace with refactored handle render fun
;; in byline refactor branch:
(concat