Skip to content

Commit 886dcfa

Browse files
committed
Fix type check for versions before 2.17
1 parent 74be2d7 commit 886dcfa

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

multiple-bibliographies.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ local utils = require 'pandoc.utils'
2020
local stringify = utils.stringify
2121
local run_json_filter = utils.run_json_filter
2222

23+
--- get the type of meta object
24+
local metatype = pandoc.utils.type or
25+
function (v)
26+
local metatag = type(v) == 'table' and v.t and v.t:gsub('^Meta', '')
27+
return metatag and metatag ~= 'Map' and metatag or type(v)
28+
end
29+
2330
--- Collection of all cites in the document
2431
local all_cites = {}
2532
--- Document meta value
@@ -64,7 +71,7 @@ local function resolve_doc_citations (doc)
6471
local meta = doc.meta
6572
local bibconf = meta.bibliography
6673
meta.bibliography = pandoc.MetaList{}
67-
if pandoc.utils.type(bibconf) == 'table' then
74+
if metatype(bibconf) == 'table' then
6875
for _, value in pairs(bibconf) do
6976
table.insert(meta.bibliography, stringify(value))
7077
end

0 commit comments

Comments
 (0)