diff --git a/news/changelog-1.8.md b/news/changelog-1.8.md index dab8f5b2161..da3608d17fa 100644 --- a/news/changelog-1.8.md +++ b/news/changelog-1.8.md @@ -1,3 +1,13 @@ All changes included in 1.8: +## Formats +### `revealjs` + +- ([#12598](https://github.com/quarto-dev/quarto-cli/pull/12598)): Ensure `.fragment` on an image with caption applies to whole figure. + +## Projects + +### `website` + +- ([#12551](https://github.com/quarto-dev/quarto-cli/pull/12551)): Improve warning issued when `aliases` would overwrite an existing document. diff --git a/src/project/types/website/website-aliases.ts b/src/project/types/website/website-aliases.ts index 9a6b9565353..6ea92b1dc22 100644 --- a/src/project/types/website/website-aliases.ts +++ b/src/project/types/website/website-aliases.ts @@ -106,10 +106,17 @@ export async function updateAliases( // Write the redirect file if (allOutputFiles.find((outputFile) => outputFile === targetFile)) { - // Do not, this is the same name as an output file! - warning( - `Aliases that you have created would overwrite the output file ${targetFile}. The aliases file was not created.`, - ); + for ( + const offendingAlias of targetHrefs.filter( + (targetHref) => + targetHref.href === + relative(dirname(targetHref.outputFile), targetFile), + ) + ) { + warning( + `Requested alias ${targetFile} -> ${offendingAlias.outputFile} would overwrite the target. Skipping.`, + ); + } } else { // Write, this is a safe file writeMultipleRedirectPage(targetFile, redirects); diff --git a/src/resources/filters/layout/pandoc3_figure.lua b/src/resources/filters/layout/pandoc3_figure.lua index ad4924e93cc..89bba648c6a 100644 --- a/src/resources/filters/layout/pandoc3_figure.lua +++ b/src/resources/filters/layout/pandoc3_figure.lua @@ -68,11 +68,25 @@ function render_pandoc3_figure() return { traverse = "topdown", Figure = function(figure) + local has_fragment = false + figure.content = _quarto.ast.walk(figure.content, { + Image = function(img) + if img.classes:includes("fragment") then + has_fragment = true + img.classes = img.classes:filter(function(c) return c ~= "fragment" end) + return img + end + end + }) + local result = html_handle_linked_image(figure) - if result ~= nil then - return result + if result == nil then + result = html_handle_image(figure) + end + if has_fragment then + result = pandoc.Div(result, pandoc.Attr("", {"fragment"}, {})) end - return html_handle_image(figure) + return result end } elseif _quarto.format.isLatexOutput() then diff --git a/tests/docs/smoke-all/2025/04/23/issue-12598.qmd b/tests/docs/smoke-all/2025/04/23/issue-12598.qmd new file mode 100644 index 00000000000..2e05526ae7d --- /dev/null +++ b/tests/docs/smoke-all/2025/04/23/issue-12598.qmd @@ -0,0 +1,13 @@ +--- +format: revealjs +_quarto: + tests: + revealjs: + ensureHtmlElements: + - ["div.fragment"] + - [] +--- + +## Slide title + +![caption](image.jpg){.fragment}