aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2014-12-18 16:25:59 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2014-12-18 16:25:59 -0200
commit9ba5f7751c088a3bbad7d98a5cf3cf23a08f1bf8 (patch)
tree0778b106b8d826f3b6ade5bf484b2b9543239004
parent641beffbc3ce72b4e1b9b6bbb79880ba795fdf72 (diff)
Don't fill comments. Affects #141
-rw-r--r--sx-question-print.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/sx-question-print.el b/sx-question-print.el
index 3d698cc..a1b7589 100644
--- a/sx-question-print.el
+++ b/sx-question-print.el
@@ -371,6 +371,7 @@ E.g.:
(defun sx-question-mode--dont-fill-here ()
"If text shouldn't be filled here, return t and skip over it."
(or (sx-question-mode--skip-and-fontify-pre)
+ (sx-question-mode--skip-comments)
;; Skip headers and references
(let ((pos (point)))
(skip-chars-forward "\r\n[:blank:]")
@@ -446,5 +447,16 @@ font-locking."
(goto-char before)
nil)))
+(defun sx-question-mode--skip-comments ()
+ "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."
+ (let ((before (point)))
+ (skip-chars-forward "\r\n[:blank:]")
+ (if (markdown-match-comments (line-end-position))
+ t
+ (goto-char before)
+ nil)))
+
(provide 'sx-question-print)
;;; sx-question-print.el ends here