Fix #1750: errors while exporting markdown

Now runs the exporters directly, rather than through shells. Also fixes
"This document format requires a nonempty..." errors with pandoc
exporter.
This commit is contained in:
Henrik Lissner 2019-09-05 14:05:27 -04:00
parent 7e36c5c2b3
commit 778c7c4244
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -36,10 +36,7 @@ otherwise throws an error."
Returns its exit code."
(when (executable-find "marked")
(apply #'call-process-region
beg end
shell-file-name nil output-buffer nil
shell-command-switch
"marked"
beg end "marked" nil output-buffer nil
(when (eq major-mode 'gfm-mode)
(list "--gfm" "--tables" "--breaks")))))
@ -48,21 +45,18 @@ Returns its exit code."
"Compiles markdown with the pandoc program, if available.
Returns its exit code."
(when (executable-find "pandoc")
(call-process-region beg end
shell-file-name nil output-buffer nil
shell-command-switch
"pandoc" "-f" "markdown" "-t" "html"
"--standalone" "--mathjax" "--highlight-style=pygments")))
(call-process-region beg end "pandoc" nil output-buffer nil
"-f" "markdown"
"-t" "html"
"--mathjax"
"--highlight-style=pygments")))
;;;###autoload
(defun +markdown-compile-multimarkdown (beg end output-buffer)
"Compiles markdown with the multimarkdown program, if available. Returns its
exit code."
(when (executable-find "multimarkdown")
(call-process-region beg end
shell-file-name nil output-buffer nil
shell-command-switch
"multimarkdown")))
(call-process-region beg end "multimarkdown" nil output-buffer)))
;;;###autoload
(defun +markdown-compile-markdown (beg end output-buffer)
@ -70,10 +64,7 @@ exit code."
available. Returns its exit code."
(when-let (exe (or (executable-find "Markdown.pl")
(executable-find "markdown")))
(call-process-region beg end
shell-file-name nil output-buffer nil
shell-command-switch
exe)))
(call-process-region beg end exe nil output-buffer nil)))
;;
;;; Commands