diff --git a/news/changelog-1.8.md b/news/changelog-1.8.md index 80524bf0da..c61db940c5 100644 --- a/news/changelog-1.8.md +++ b/news/changelog-1.8.md @@ -3,7 +3,8 @@ ## In this release - ([#13396](https://github.com/quarto-dev/quarto-cli/issues/13396)): Fix `quarto publish connect` regression. -- ([#13418](https://github.com/quarto-dev/quarto-cli/issues/13418): Resolve logo paths specified directly in `brand.logo.{size}`. +- ([#13418](https://github.com/quarto-dev/quarto-cli/issues/13418)): Resolve logo paths specified directly in `brand.logo.{size}`. +- ([#13445](https://github.com/quarto-dev/quarto-cli/pull/13445)): Brand logo shortcode will not add `.light-content`, `.dark-content` classes when `light` or `dark` is specifically requested. # v1.8 changes 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: - - - '