From 7ee1f7f1f28777d2d69a7ef589f6c7c6667835c3 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sun, 19 Apr 2015 17:05:00 +0100 Subject: Hide html comments --- sx-question-print.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sx-question-print.el') diff --git a/sx-question-print.el b/sx-question-print.el index ed13b71..096586a 100644 --- a/sx-question-print.el +++ b/sx-question-print.el @@ -759,7 +759,15 @@ move point, don't create the code-block button." "If there's an html comment ahead, skip it and return t." ;; @TODO: Handle the comment. ;; "Handling means to store any relevant metadata it might be holding." - (markdown-match-comments (line-end-position))) + (let ((end (save-excursion + (when (markdown-match-comments (line-end-position)) + (point))))) + (when end + (delete-region (point) end) + (skip-chars-backward "[:blank:]") + (when (looking-at "^[:blank:]*\n") + (replace-match "")) + t))) (defun sx-question-mode--skip-headline () "If there's a headline ahead, skip it and return non-nil." -- cgit v1.2.3