Add Pandoc support, refactor external helpers

Recognize the Pandoc format under the file extension .pandoc or .pdc,
and shell out to pandoc as an external helper to format Pandoc content.

Refactor out repeated code with external helpers. Change the error
output formatting. I did not see any of the external helpers print the
string "<input>" to represent stdin as a file; just prepending the file
name to error output is more general and doesn't sacrifice that much in
terms of readability.

Closes #234
This commit is contained in:
Brian Chen
2017-11-30 06:15:52 -05:00
committed by Bjørn Erik Pedersen
parent e7652180a1
commit e69da7a4cb
7 changed files with 74 additions and 60 deletions

View File

@@ -34,6 +34,8 @@ func TestGuessType(t *testing.T) {
{"adoc", "asciidoc"},
{"ad", "asciidoc"},
{"rst", "rst"},
{"pandoc", "pandoc"},
{"pdc", "pandoc"},
{"mmark", "mmark"},
{"html", "html"},
{"htm", "html"},