diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-12 21:48:40 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-12 21:48:40 -0200 |
commit | 66af19c7df5b1ef2d3252593b4eb33a101dc1582 (patch) | |
tree | fa6d6d3360b6912fd4c14cbc31e6832bfee9216c /sx-question-print.el | |
parent | 10f0c60b4c817172d5bfd12bfe8993fcbb7b3037 (diff) |
fix images
Diffstat (limited to 'sx-question-print.el')
-rw-r--r-- | sx-question-print.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sx-question-print.el b/sx-question-print.el index 7244a6a..160074d 100644 --- a/sx-question-print.el +++ b/sx-question-print.el @@ -427,7 +427,7 @@ Image links are downloaded and displayed, if url)) url) (when image-p - (sx-question-mode--create-image url (1- (point))))))))))) + (sx-question-mode--create-image url (- (point) 2)))))))))) (defun sx-question-mode--create-image (url point) "Get and create an image from URL and insert it at POINT. @@ -445,7 +445,8 @@ Its size is bound by `sx-question-mode-image-max-width' and (list :width (min sx-question-mode-image-max-width (window-body-width nil 'pixel) image-width)))))))) - (sx-request-get-url url callback))) + (sx-request-get-url url callback) + (overlay-put ov 'face 'default))) (defun sx-question-mode--insert-link (text url) "Return a link propertized version of TEXT-OR-IMAGE. @@ -459,7 +460,7 @@ URL is used as 'help-echo and 'url properties." (forward-char 1) (delete-char 1))) ;; Images need to be at the start of a line. - (when (and imagep (not (looking-at-p "^"))) + (unless (or text (looking-at-p "^")) (insert "\n")) (insert-text-button (or text " ") ;; Mouse-over @@ -472,7 +473,7 @@ URL is used as 'help-echo and 'url properties." 'sx-button-copy url :type 'sx-button-link) ;; Images need to be at the end of a line too. - (insert "\n")) + (unless text (insert "\n"))) (defun sx-question-mode-find-reference (id &optional fallback-id) "Find url identified by reference ID in current buffer. |