diff --git a/src/resources/filters/quarto-pre/shortcodes-handlers.lua b/src/resources/filters/quarto-pre/shortcodes-handlers.lua index 5f241cc886..f9961de308 100644 --- a/src/resources/filters/quarto-pre/shortcodes-handlers.lua +++ b/src/resources/filters/quarto-pre/shortcodes-handlers.lua @@ -174,12 +174,14 @@ function initShortcodeHandlers() end local images = {} if lightLogo then + local classes = brandMode == 'both' and {"light-content"} or {} table.insert(images, pandoc.Image(pandoc.Inlines {}, add_leading_slash(lightLogo.path), "", - pandoc.Attr("", {"light-content"}, {alt = lightLogo.alt}))) + pandoc.Attr("", classes, {alt = lightLogo.alt}))) end if darkLogo then + local classes = brandMode == 'both' and {"dark-content"} or {} table.insert(images, pandoc.Image(pandoc.Inlines {}, add_leading_slash(darkLogo.path), "", - pandoc.Attr("", {"dark-content"}, {alt = darkLogo.alt}))) + pandoc.Attr("", classes, {alt = darkLogo.alt}))) end if context == "block" then return pandoc.Blocks(images) diff --git a/tests/docs/smoke-all/shortcodes/brand-logo-dark.qmd b/tests/docs/smoke-all/shortcodes/brand-logo-dark.qmd index 5af745241c..bf26a55a6d 100644 --- a/tests/docs/smoke-all/shortcodes/brand-logo-dark.qmd +++ b/tests/docs/smoke-all/shortcodes/brand-logo-dark.qmd @@ -13,7 +13,7 @@ _quarto: html: ensureFileRegexMatches: - - - '