Skip to content

Commit 8e743fc

Browse files
committed
allow plain string as callout caption
1 parent cbb06a9 commit 8e743fc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/resources/filters/quarto-pre/callout.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ _quarto.ast.add_handler({
9191
constructor = function(tbl)
9292
preState.hasCallouts = true
9393

94-
local type = tbl.type
94+
local t = tbl.type
9595
local iconDefault = true
9696
local appearanceDefault = nil
97-
if type == "none" then
97+
if t == "none" then
9898
iconDefault = false
9999
appearanceDefault = "simple"
100100
end
@@ -117,13 +117,17 @@ _quarto.ast.add_handler({
117117
end
118118
local content = pandoc.Blocks({})
119119
content:extend(tbl.content)
120+
local caption = tbl.caption
121+
if type(caption) == "string" then
122+
caption = pandoc.Str(caption)
123+
end
120124
return {
121-
caption = tbl.caption,
125+
caption = caption,
122126
collapse = tbl.collapse,
123127
content = content,
124128
appearance = appearance,
125129
icon = icon,
126-
type = type,
130+
type = t,
127131
}
128132
end
129133
})

0 commit comments

Comments
 (0)