Skip to content

Commit 0b05213

Browse files
committed
minted: make it work with 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 7d63e09 commit 0b05213

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

minted/minted.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,7 @@ local function minted_attributes(elem, kind)
195195

196196
-- Value options using key=value (e.g., ```{.bash fontsize=\scriptsize}) show
197197
-- up in the list of attributes.
198-
for _, attr in ipairs(elem.attributes) do
199-
cls, value = attr[1], attr[2]
198+
for cls, value in pairs(elem.attributes) do
200199
if is_minted_class(cls) then
201200
table.insert(minted_attributes, cls .. "=" .. value)
202201
table.insert(minted_keys, cls)
@@ -250,8 +249,7 @@ local function remove_minted_attibutes(elem)
250249

251250
-- Remove any minted items from the attributes.
252251
extra_attrs = {}
253-
for _, attr in ipairs(elem.attributes) do
254-
cls, value = attr[1], attr[2]
252+
for cls, value in pairs(elem.attributes) do
255253
if not is_minted_class(cls) then
256254
table.insert(extra_attrs, {cls, value})
257255
end

0 commit comments

Comments
 (0)