Skip to content

Commit 1e79b46

Browse files
committed
Add JATs specific callout impl
1 parent 1fb2efe commit 1e79b46

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ function callout()
6969
return calloutDocx(div)
7070
elseif _quarto.format.isEpubOutput() or _quarto.format.isRevealJsOutput() then
7171
return epubCallout(div)
72+
elseif _quarto.format.isJatsOutput() then
73+
return jatsCallout(div)
7274
else
7375
return simpleCallout(div)
7476
end
@@ -704,6 +706,19 @@ function epubCallout(div)
704706
return pandoc.Div({calloutBody}, pandoc.Attr(div.attr.identifier, attributes))
705707
end
706708

709+
function jatsCallout(div)
710+
local icon, type, contents = resolveCalloutContents(div, true)
711+
712+
local boxedStart = '<boxed-text>'
713+
if div.attr.identifier and div.attr.identifier ~= '' then
714+
boxedStart = "<boxed-text id='" .. div.attr.identifier .. "'>"
715+
end
716+
717+
contents:insert(1, pandoc.RawBlock('jats', boxedStart))
718+
contents:insert(pandoc.RawBlock('jats', '</boxed-text>'))
719+
return pandoc.Div(contents)
720+
end
721+
707722
function simpleCallout(div)
708723
local icon, type, contents = resolveCalloutContents(div, true)
709724
local callout = pandoc.BlockQuote(contents)

0 commit comments

Comments
 (0)