aboutsummaryrefslogtreecommitdiff
path: root/sx-question-print.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-01-24 01:25:29 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-01-24 01:25:29 -0200
commite8becf0aa8fd823a73a16292fffc261be7c4b9f5 (patch)
treeba9e8cfbbfa4a563f6c871c0695151e0c6addc05 /sx-question-print.el
parent5a4c4dba75ad605110a4415478072cdb4a907b20 (diff)
Sorround images with newlines
Diffstat (limited to 'sx-question-print.el')
-rw-r--r--sx-question-print.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/sx-question-print.el b/sx-question-print.el
index e76e006..924608b 100644
--- a/sx-question-print.el
+++ b/sx-question-print.el
@@ -410,6 +410,9 @@ Image links are downloaded and displayed, if
"Return a link propertized version of TEXT-OR-IMAGE.
URL is used as 'help-echo and 'url properties."
(let ((imagep (not (stringp text-or-image))))
+ ;; Images need to be at the start of a line.
+ (when (and imagep (not (looking-at-p "^")))
+ (insert "\n"))
(apply #'insert-text-button
(if imagep " " text-or-image)
;; Mouse-over
@@ -423,7 +426,9 @@ URL is used as 'help-echo and 'url properties."
:type 'sx-button-link
;; The last argument of `apply' is a list.
(when imagep
- `(face default display ,text-or-image)))))
+ `(face default display ,text-or-image)))
+ ;; Images need to be at the end of a line too.
+ (insert "\n")))
(defun sx-question-mode-find-reference (id &optional fallback-id)
"Find url identified by reference ID in current buffer.