Skip to content

Commit 6b451da

Browse files
committed
Rely less on pandoc's type implicit conversions
1 parent 5a5441c commit 6b451da

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

src/resources/filters/ast/customnodes.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,10 @@ _quarto.ast = {
387387
_quarto.ast.grow_scaffold(node, index)
388388
end
389389
local pt = pandoc.utils.type(value)
390-
if pt == "Block" or pt == "Inline" then
391-
node.content[index].content = {value}
390+
if pt == "Block" then
391+
node.content[index].content = pandoc.Blocks{value}
392+
elseif pt == "Inline" then
393+
node.content[index].content = pandoc.Inlines{value}
392394
else
393395
node.content[index].content = value
394396
end

src/resources/filters/crossref/equations.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function process_equations(blockEl)
2020
end
2121

2222
local mathInlines = nil
23-
local targetInlines = pandoc.List()
23+
local targetInlines = pandoc.Inlines{}
2424

2525
for i, el in ipairs(inlines) do
2626

src/resources/filters/layout/html.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function renderHtmlFigure(el, render)
190190
end)
191191

192192
-- remove identifier (it is now on the div)
193-
el.identifier = ""
193+
el.attr.identifier = ""
194194

195195
if not figureDiv.classes:find_if(function(str) return str:match("quarto%-figure%-.+") end) then
196196
-- apply standalone figure css if not already set

src/resources/filters/quarto-pre/code-annotation.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ function code_annotations()
310310
-- if code annotations is false, then shut it down
311311
if codeAnnotations ~= false then
312312

313-
local outputs = pandoc.List()
313+
local outputs = pandoc.Blocks{}
314314

315315
-- annotations[annotation-number] = {list of line numbers}
316316
local pendingAnnotations = nil

0 commit comments

Comments
 (0)