Skip to content

Commit c50addc

Browse files
committed
multiple-bibliographies: fix filter for pandoc 2.16.1 & Lua 5.3.3 combo
The filter already worked with pandoc 2.16.1, but only when compiled with Lua 5.3.6. The Lua interpreter included in Ubuntu doesn't allow non-table values as arguments to `ipairs`.
1 parent 89e0113 commit c50addc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

section-refs/section-refs.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-- pandoc.utils.make_sections exists since pandoc 2.8
22
if PANDOC_VERSION == nil then -- if pandoc_version < 2.1
3-
error("ERROR: pandoc >= 2.1 required for section-refs filter")
3+
error("ERROR: pandoc >= 2.8 required for section-refs filter")
44
else
55
PANDOC_VERSION:must_be_at_least {2,8}
66
end
@@ -37,10 +37,10 @@ local function adjust_refs_components (div)
3737
end
3838
local blocks = div.content
3939
local bib_header = blocks:find_if(function (b)
40-
return b.identifier == 'bibliography'
40+
return b.attr and b.identifier == 'bibliography'
4141
end)
4242
local refs = blocks:find_if(function (b)
43-
return b.identifier == 'refs'
43+
return b.attr and b.identifier == 'refs'
4444
end)
4545
if bib_header then
4646
bib_header.identifier = 'bibliography-' .. header.attributes.number

0 commit comments

Comments
 (0)