From 67e4c3b560cd0749be1b101be8b5157f5b1e1184 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Tue, 15 Apr 2025 15:23:31 -0400 Subject: [PATCH 1/5] website - improve warning when alias redirection would overwrite file --- src/project/types/website/website-aliases.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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); From 1428f741152e7f8553f900fbb7b4a850b19646fc Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Wed, 23 Apr 2025 14:21:52 -0400 Subject: [PATCH 2/5] revealjs - hoist Figure.fragment to surrounding div --- .../filters/layout/pandoc3_figure.lua | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) 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 From 8eb9cc89d653522bfc368fa14a1579e6366833e3 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Wed, 23 Apr 2025 14:22:42 -0400 Subject: [PATCH 3/5] regression test --- tests/docs/smoke-all/2025/04/23/issue-12598.qmd | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/docs/smoke-all/2025/04/23/issue-12598.qmd 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} From 14e71dc6e3dfc75cb1ba3e1ff882c461e98a7e58 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Tue, 29 Apr 2025 10:30:01 -0400 Subject: [PATCH 4/5] changelog --- news/changelog-1.8.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/news/changelog-1.8.md b/news/changelog-1.8.md index dab8f5b2161..9ed804fde30 100644 --- a/news/changelog-1.8.md +++ b/news/changelog-1.8.md @@ -1,3 +1,7 @@ All changes included in 1.8: +## Projects +### `website` + +- ([#12551](https://github.com/quarto-dev/quarto-cli/pull/12551)): Improve warning issued when `aliases` would overwrite an existing document. From 2f070ee6ded51b0ab2bfe308cc20ae4bca832c52 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Tue, 29 Apr 2025 10:32:12 -0400 Subject: [PATCH 5/5] changelog --- news/changelog-1.8.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/news/changelog-1.8.md b/news/changelog-1.8.md index 9ed804fde30..da3608d17fa 100644 --- a/news/changelog-1.8.md +++ b/news/changelog-1.8.md @@ -1,5 +1,11 @@ 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`