Skip to content

Commit 43d2315

Browse files
committed
transfer id to callout div
1 parent c1bf817 commit 43d2315

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@ function calloutDiv(div)
143143
local collapse = div.attr.attributes["collapse"]
144144
div.attr.attributes["collapse"] = nil
145145

146-
-- Make an outer card div and transfer classes
146+
-- Make an outer card div and transfer classes and id
147147
local calloutDiv = pandoc.Div({})
148+
calloutDiv.attr.identifier = div.attr.identifier
148149
calloutDiv.attr.classes = div.attr.classes:clone()
149150
div.attr.classes = pandoc.List()
150151
div.attr.classes:insert("callout-body-container")
@@ -680,13 +681,13 @@ function epubCallout(div)
680681
end
681682
attributes:insert("callout-style-" .. calloutAppearance)
682683

683-
return pandoc.Div({calloutBody}, pandoc.Attr("", attributes))
684+
return pandoc.Div({calloutBody}, pandoc.Attr(div.attr.identifier, attributes))
684685
end
685686

686687
function simpleCallout(div)
687688
local icon, type, contents = resolveCalloutContents(div, true)
688689
local callout = pandoc.BlockQuote(contents)
689-
return pandoc.Div(callout)
690+
return pandoc.Div(callout, pandoc.Attr(div.attr.identifier))
690691
end
691692

692693
function resolveCalloutContents(div, requireCaption)

0 commit comments

Comments
 (0)