diff options
author | Gustav Eek <gustav.eek@fripost.org> | 2019-10-06 00:28:12 +0200 |
---|---|---|
committer | Gustav Eek <gustav.eek@fripost.org> | 2019-10-06 00:28:12 +0200 |
commit | 4cce91fd9356b3c5f440382bdd498f11ec7f1362 (patch) | |
tree | 544b1a87096bc80c93534b591b45966aa658553a | |
parent | 69dcba3dd8751624e792dc63d4ffa9cb3e7f93e9 (diff) |
Update Pandoc plugin for Ikiwiki to upstream HEAD
Pandoc plugin, *pandoc.pm*, is updated for the upstream HEAD:
>https://github.com/sciunto-org/ikiwiki-pandoc.git>
> e0b6a52
> 2019-02-02T18:52:47+00:00
> Merge pull request #23 from mletterle/format-arg
> baldur.kristinsson@gmail.com
In Pandoc 2.2.1, packaged for Debian 10 Buster, options `--smart/-S`
are removed as well as `--normalize`. Normalisation is default and one
should use `+smart` or `-smart` extension instead.
This version of the Ikiwiki plugin is compatible for those
-rwxr-xr-x | .ikiwiki/IkiWiki/Plugin/pandoc.pm | 16 |
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 } |