From fd0d3342ea90328ff5b6b24b0b328a699683bedc Mon Sep 17 00:00:00 2001 From: Gustav Eek Date: Mon, 20 Jan 2020 18:36:08 +0100 Subject: [PATCH] Feature. Push listed meta variables to template. In function *pagetemplate*, template variables are added as pandas_* variables. This fix provides also those listed as scalar and list meta keys without the Pandoc prefix. --- pandoc.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandoc.pm b/pandoc.pm index be44a06..9f945bf 100755 --- a/pandoc.pm +++ b/pandoc.pm @@ -611,7 +611,9 @@ sub pagetemplate (@) { my $page = $params{page}; my $template = $params{template}; foreach my $k (keys %{$pagestate{$page}{meta}}) { - next unless $k =~ /^pandoc_/; + next unless + (grep {/^$k$/} (@scalar_meta_keys, @list_meta_keys)) || + ($k =~ /^(pandoc_)/); $template->param($k => $pagestate{$page}{meta}{$k}); } return $template; -- 2.39.5