diff options
author | Alexander Griffith <griffitaj@gmail.com> | 2017-05-12 01:18:19 -0400 |
---|---|---|
committer | Alexander Griffith <griffitaj@gmail.com> | 2017-05-12 01:18:19 -0400 |
commit | d154f9fa762a258601015b44895eed5cbbdc7d78 (patch) | |
tree | 60e0601efe00b5b51f5a4c4c2aedd6fbfaf67bbd /lisp/mastodon-tl.el | |
parent | 4d0bd43c0ede0159c0f0130a5565ea5a6511997a (diff) |
closed #79
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r-- | lisp/mastodon-tl.el | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index e025a6e..12b739b 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -177,14 +177,16 @@ also render the html" (defun mastodon-tl--media (toot) "Retrieve a media attachment link for TOOT if one exists." - (let ((media (mastodon-tl--field 'media_attachments toot))) - (mapconcat - (lambda (media-preview) - (concat "Media_Link:: " - (mastodon-tl--set-face - (cdr (assoc 'preview_url media-preview)) - 'mouse-face nil))) - media "\n"))) + (let* ((media (mastodon-tl--field 'media_attachments toot)) + (media-string (mapconcat + (lambda (media-preview) + (concat "Media_Link:: " + (mastodon-tl--set-face + (cdr (assoc 'preview_url media-preview)) + 'mouse-face nil))) + media "\n"))) + (if (not (equal media-string "")) + (concat "\n" media-string ) ""))) (defun mastodon-tl--content (toot) "Retrieve text content from TOOT." @@ -201,8 +203,9 @@ also render the html" (insert (concat (mastodon-tl--spoiler toot) - (mastodon-tl--content toot) + (replace-regexp-in-string "\n*$" "" (mastodon-tl--content toot)) (mastodon-tl--media toot) + "\n\n" (mastodon-tl--byline toot) "\n\n"))) |