diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-07 01:18:04 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-09 14:15:33 +0000 |
commit | 4898b1669b54a8afca3303e70f01a9825cbe01d1 (patch) | |
tree | d4396b30dc27445966a77ef4fdbffc8bfe37c0df /sx-question-print.el | |
parent | 3da6e5174cbb3a2d551a9862dd79655908e2e0fc (diff) |
Patch sx and sx-question-print to use sx-babel.
Diffstat (limited to 'sx-question-print.el')
-rw-r--r-- | sx-question-print.el | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/sx-question-print.el b/sx-question-print.el index 2a0a035..fe64392 100644 --- a/sx-question-print.el +++ b/sx-question-print.el @@ -431,29 +431,19 @@ If ID is nil, use FALLBACK-ID instead." "If there's a pre block ahead, handle it, skip it and return t. Handling means to turn it into a button and remove erroneous font-locking." - (let (beg end text) + (let (beg end) (when (markdown-match-pre-blocks (save-excursion (skip-chars-forward "\r\n[:blank:]") (setq beg (point)))) (setq end (point)) - (setq text - (sx--unindent-text - (buffer-substring - (save-excursion - (goto-char beg) - (line-beginning-position)) - end))) - (put-text-property beg end 'display nil) - (make-text-button - beg end - 'face 'markdown-pre-face - 'sx-button-copy text - :type 'sx-question-mode-code-block)))) + (sx-babel--make-pre-button + (buffer-substring + (save-excursion + (goto-char beg) + (line-beginning-position)) + end))))) (provide 'sx-question-print) ;;; sx-question-print.el ends here -;; Local Variables: -;; lexical-binding: t -;; End: |