aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-04-02 20:37:14 +0100
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-04-02 20:37:14 +0100
commit517dfb1d5ee199ede3ebdafe2654be33e4798571 (patch)
tree32e92697744acc659103768d22abcaa698cee137
parent23a617eb0dead4ef3c1398c09eb5185294c87bc4 (diff)
Trim whitespace around markdown body.
-rw-r--r--sx-question-print.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/sx-question-print.el b/sx-question-print.el
index 6a7607d..2e00550 100644
--- a/sx-question-print.el
+++ b/sx-question-print.el
@@ -473,6 +473,15 @@ font-locks code-blocks according to mode."
;; affects the entire buffer even if we narrow.
(with-temp-buffer
(insert text)
+ ;; Trim whitespace
+ (goto-char (point-max))
+ (skip-chars-backward "\r\n[:blank:]")
+ (delete-region (point) (point-max))
+ (goto-char (point-min))
+ (skip-chars-forward "\r\n[:blank:]")
+ (forward-line 0)
+ (delete-region (point-min) (point))
+ ;; Font lock
(delay-mode-hooks (markdown-mode))
(font-lock-mode -1)
(when sx-question-mode-bullet-appearance