From 517dfb1d5ee199ede3ebdafe2654be33e4798571 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Thu, 2 Apr 2015 20:37:14 +0100 Subject: Trim whitespace around markdown body. --- sx-question-print.el | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- cgit v1.2.3