Skip to content

Commit cac0f60

Browse files
authored
Merge branch 'main' into bugfix/12616
2 parents d81e126 + b563f06 commit cac0f60

File tree

4 files changed

+48
-8
lines changed

4 files changed

+48
-8
lines changed

news/changelog-1.8.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
All changes included in 1.8:
22

3+
## Formats
4+
5+
### `revealjs`
6+
7+
- ([#12598](https://github.com/quarto-dev/quarto-cli/pull/12598)): Ensure `.fragment` on an image with caption applies to whole figure.
38

49
## Projects
510

611
### `website`
712

8-
- ([#12616](https://github.com/quarto-dev/quarto-cli/issues/12616)): find SVG images in image discovery for listings.
13+
- ([#12551](https://github.com/quarto-dev/quarto-cli/pull/12551)): Improve warning issued when `aliases` would overwrite an existing document.
14+
- ([#12616](https://github.com/quarto-dev/quarto-cli/issues/12616)): find SVG images in image discovery for listings.

src/project/types/website/website-aliases.ts

+11-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,17 @@ export async function updateAliases(
106106

107107
// Write the redirect file
108108
if (allOutputFiles.find((outputFile) => outputFile === targetFile)) {
109-
// Do not, this is the same name as an output file!
110-
warning(
111-
`Aliases that you have created would overwrite the output file ${targetFile}. The aliases file was not created.`,
112-
);
109+
for (
110+
const offendingAlias of targetHrefs.filter(
111+
(targetHref) =>
112+
targetHref.href ===
113+
relative(dirname(targetHref.outputFile), targetFile),
114+
)
115+
) {
116+
warning(
117+
`Requested alias ${targetFile} -> ${offendingAlias.outputFile} would overwrite the target. Skipping.`,
118+
);
119+
}
113120
} else {
114121
// Write, this is a safe file
115122
writeMultipleRedirectPage(targetFile, redirects);

src/resources/filters/layout/pandoc3_figure.lua

+17-3
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,25 @@ function render_pandoc3_figure()
6868
return {
6969
traverse = "topdown",
7070
Figure = function(figure)
71+
local has_fragment = false
72+
figure.content = _quarto.ast.walk(figure.content, {
73+
Image = function(img)
74+
if img.classes:includes("fragment") then
75+
has_fragment = true
76+
img.classes = img.classes:filter(function(c) return c ~= "fragment" end)
77+
return img
78+
end
79+
end
80+
})
81+
7182
local result = html_handle_linked_image(figure)
72-
if result ~= nil then
73-
return result
83+
if result == nil then
84+
result = html_handle_image(figure)
85+
end
86+
if has_fragment then
87+
result = pandoc.Div(result, pandoc.Attr("", {"fragment"}, {}))
7488
end
75-
return html_handle_image(figure)
89+
return result
7690
end
7791
}
7892
elseif _quarto.format.isLatexOutput() then
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
format: revealjs
3+
_quarto:
4+
tests:
5+
revealjs:
6+
ensureHtmlElements:
7+
- ["div.fragment"]
8+
- []
9+
---
10+
11+
## Slide title
12+
13+
![caption](image.jpg){.fragment}

0 commit comments

Comments
 (0)