aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-04-30 16:34:07 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-04-30 16:34:07 +0200
commit91b5c03eb49c5bf6d1da00d6bf6f192b4a592f16 (patch)
tree67a3a59d147c524c4c81a6d8865a3c7d305d4910
parent84753be746df2bcaa66ff54a60e2dfc63c214826 (diff)
tl media adjust line breaks
-rw-r--r--lisp/mastodon-tl.el29
1 files changed, 14 insertions, 15 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index be6609f..ae51877 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1038,8 +1038,7 @@ message is a link which unhides/hides the main body."
(defun mastodon-tl--media-attachment (media-attachment)
"Return a propertized string for MEDIA-ATTACHMENT."
- (let* ((preview-url
- (alist-get 'preview_url media-attachment))
+ (let* ((preview-url (alist-get 'preview_url media-attachment))
(remote-url
(or (alist-get 'remote_url media-attachment)
;; fallback b/c notifications don't have remote_url
@@ -1056,19 +1055,19 @@ message is a link which unhides/hides the main body."
(mastodon-media--get-media-link-rendering
preview-url remote-url type caption) ; 2nd arg for shr-browse-url
;; return URL/caption:
- (concat
- (mastodon-tl--propertize-img-str-or-url
- (concat "Media:: " preview-url) ;; string
- preview-url remote-url type caption
- display-str ;; display
- ;; FIXME: shr-link underlining is awful for captions with
- ;; newlines, as the underlining runs to the edge of the
- ;; frame even if the text doesn'
- 'shr-link)
- "\n"))))
-
-(defun mastodon-tl--propertize-img-str-or-url (str media-url full-remote-url type
- help-echo &optional display face)
+ (concat (mastodon-tl--propertize-img-str-or-url
+ (concat "Media:: " preview-url) ;; string
+ preview-url remote-url type caption
+ display-str ;; display
+ ;; FIXME: shr-link underlining is awful for captions with
+ ;; newlines, as the underlining runs to the edge of the
+ ;; frame even if the text doesn'
+ 'shr-link)
+ "\n"))))
+
+(defun mastodon-tl--propertize-img-str-or-url (str media-url full-remote-url
+ type help-echo
+ &optional display face)
"Propertize an media placeholder string \"[img]\" or media URL.
STR is the string to propertize, MEDIA-URL is the preview link,
FULL-REMOTE-URL is the link to the full resolution image on the