From: Michael Letterle Date: Sat, 2 Feb 2019 17:55:18 +0000 (-0500) Subject: Allow specification of pandoc markdown format X-Git-Url: https://git.g-eek.se/?a=commitdiff_plain;h=3d4f9b56b42bee8c74c8caf7ce4bd9ca767c9407;p=ikiwiki-pandoc.git Allow specification of pandoc markdown format This allows for the disabling and enabling of Pandoc extensions. Notably it allows one to specify `markdown-space_in_atx_header-startnum` which corresponds with some of the old ikiwiki markdown behavior. --- diff --git a/pandoc.pm b/pandoc.pm index 789e388..49386ee 100755 --- a/pandoc.pm +++ b/pandoc.pm @@ -96,6 +96,13 @@ sub getsetup () { safe => 1, rebuild => 1, }, + pandoc_markdown_fmt => { + type => "string", + example => "markdown", + description => "Format string to use when processing files handled by Pandoc.", + safe => 1, + rebuild => 1, + }, pandoc_latex => { type => "boolean", example => 0, @@ -409,8 +416,9 @@ sub htmlize ($@) { # can be parsed out # We must omit the 'bibliography' parameter here, otherwise the list of # references will be doubled. + my $markdown_fmt = $config{pandoc_markdown_fmt} || 'markdown'; my $to_json_pid = open2(*JSON_OUT, *PANDOC_OUT, $command, - '-f', $format, + '-f', $markdown_fmt, '-t', 'json', @args); error("Unable to open $command") unless $to_json_pid;