summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.ikiwiki/IkiWiki/Plugin/pandoc.pm16
1 files changed, 12 insertions, 4 deletions
diff --git a/.ikiwiki/IkiWiki/Plugin/pandoc.pm b/.ikiwiki/IkiWiki/Plugin/pandoc.pm
index 25081ef..da13763 100755
--- a/.ikiwiki/IkiWiki/Plugin/pandoc.pm
+++ b/.ikiwiki/IkiWiki/Plugin/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,10 +416,11 @@ 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, '--normalize');
+ @args);
error("Unable to open $command") unless $to_json_pid;
# Workaround for perl bug (#376329)
@@ -435,8 +443,8 @@ sub htmlize ($@) {
my $meta = undef;
my $decoded_json = decode_json($json_content);
# The representation of the meta block changed in pandoc version 1.18
- if (ref $decoded_json eq 'HASH' && $decoded_json->{'Meta'}) {
- $meta = $decoded_json->{'Meta'} || {}; # post-1.18 version
+ if (ref $decoded_json eq 'HASH' && $decoded_json->{'meta'}) {
+ $meta = $decoded_json->{'meta'} || {}; # post-1.18 version
} elsif (ref $decoded_json eq 'ARRAY') {
$meta = $decoded_json->[0]->{'unMeta'} || {}; # pre-1.18 version
}