diff --git a/src/resources/filters/layout/pandoc3_figure.lua b/src/resources/filters/layout/pandoc3_figure.lua index 1778513b569..e83cef6142c 100644 --- a/src/resources/filters/layout/pandoc3_figure.lua +++ b/src/resources/filters/layout/pandoc3_figure.lua @@ -49,6 +49,10 @@ function render_pandoc3_figure() if figure.caption.long ~= nil then image.caption = quarto.utils.as_inlines(figure.caption.long) end + -- TODO need to find all correct classes to forward + if figure.classes:includes("margin-caption") then + image.classes:insert("margin-caption") + end return htmlImageFigure(image) end diff --git a/tests/docs/smoke-all/2024/01/05/8066.qmd b/tests/docs/smoke-all/2024/01/05/8066.qmd new file mode 100644 index 00000000000..737b0ba716e --- /dev/null +++ b/tests/docs/smoke-all/2024/01/05/8066.qmd @@ -0,0 +1,15 @@ +--- +title: "Test" +format: + html: + fig-cap-location: margin +_quarto: + tests: + html: + ensureHtmlElements: + - + - "figcaption.margin-caption" + - [] +--- + +![Test figure caption](https://placeholder.co/400)