Skip to content

Commit b652ee8

Browse files
authored
Merge branch 'main' into fix/issue9468
2 parents 51d502b + d7b29c3 commit b652ee8

File tree

8 files changed

+44
-5
lines changed

8 files changed

+44
-5
lines changed

.github/workflows/test-quarto-latexmk.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ jobs:
4242
if: runner.os == 'macOS'
4343
run: |
4444
cd package/src
45-
./quarto-bld compile-quarto-latexmk --target x86_64-apple-darwin --name tinitex
45+
./quarto-bld compile-quarto-latexmk --target aarch64-apple-darwin --name tinitex
4646
ls -R ../dist/bin
47-
../dist/bin/tinitex/x86_64-apple-darwin/tinitex --help
47+
../dist/bin/tinitex/aarch64-apple-darwin/tinitex --help
4848
4949
- name: Test Linux
5050
if: runner.os == 'Linux'

news/changelog-1.5.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ All changes included in 1.5:
158158
- ([#9282](https://github.com/quarto-dev/quarto-cli/issues/9282)): Fix name clash in Lua local declarations for `mediabag` in bundled releases.
159159
- ([#9394](https://github.com/quarto-dev/quarto-cli/issues/9394)): Make `template` a required field in the `about` schema.
160160
- ([#9426](https://github.com/quarto-dev/quarto-cli/issues/9426)): Update `crossref.lua` filter to avoid crashes and hangs in documents with custom AST nodes.
161+
- ([#9492](https://github.com/quarto-dev/quarto-cli/issues/9492)): Improve performance of `quarto preview` when serving resource files of the following formats: HTML, PDF, DOCX, and plaintext.
161162
- Add support for `{{< lipsum >}}` shortcode, which is useful for emitting placeholder text. Provide a specific number of paragraphs (`{{< lipsum 3 >}}`).
162163
- Resolve data URIs in Pandoc's mediabag when rendering documents.
163164
- Increase v8's max heap size by default, to avoid out-of-memory errors when rendering large documents (also cf. https://github.com/denoland/deno/issues/18935).

package/scripts/vendoring/vendor.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,5 @@ else
4646
rm -rf vendor-${today}
4747
fi
4848
$DENO_BIN_PATH run --no-config --unstable-ffi --allow-all --importmap=$QUARTO_SRC_PATH/import_map.json $QUARTO_PACKAGE_PATH/src/common/create-dev-import-map.ts
49+
popd
50+
source configure.sh

src/project/serve/serve.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,20 @@ async function internalPreviewServer(
560560
watcher.project(),
561561
filePathRelative,
562562
);
563+
564+
if (!inputFile) {
565+
// If we couldn't find a input file, check if this is a resource file.
566+
// If so, we can bail out early, since we don't need to render it.
567+
// This is great for performance, as refreshing the watcher can be slow.
568+
const fileSourcePath = join(watcher.project().dir, filePathRelative);
569+
const projectResourceFiles = watcher.project().files.resources;
570+
if (projectResourceFiles?.includes(fileSourcePath)) {
571+
return undefined;
572+
}
573+
}
574+
563575
if (!inputFile || !existsSync(inputFile.file)) {
576+
// If we got here, we need to look harder for an input file.
564577
inputFile = await inputFileForOutputFile(
565578
await watcher.refreshProject(),
566579
filePathRelative,

src/resources/filters/layout/docx.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function docxDivCaption(captionEl, align)
9090
local caption = pandoc.Para({
9191
pandoc.RawInline("openxml", docxParaStyles(align))
9292
})
93-
tappend(caption.content, captionEl.content)
93+
tappend(caption.content, captionEl and captionEl.content or pandoc.Inlines({}))
9494
return caption
9595
end
9696

src/resources/filters/layout/lightbox.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,12 @@ function lightbox()
144144
subFloatEl = _quarto.ast.walk(subFloatEl, {
145145
traverse = 'topdown',
146146
Image = function(imgEl)
147-
local caption_content = subFloatEl.caption_long.content or subFloatEl.caption_long
147+
local caption_content
148+
if subFloatEl.caption_long then
149+
caption_content = subFloatEl.caption_long.content or subFloatEl.caption_long
150+
else
151+
caption_content = pandoc.Inlines({})
152+
end
148153
local caption = full_caption_prefix(parentFloat, subFloatEl)
149154
tappend(caption, caption_content)
150155
local subImgModified = processImg(imgEl, { automatic = true, caption = caption, gallery = gallery })

src/resources/filters/quarto-pre/parsefiguredivs.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,8 @@ function parse_floatreftargets()
514514
local type = refType(identifier)
515515
local category = crossref.categories.by_ref_type[type]
516516
if category == nil then
517-
warn("Figure with invalid crossref category: " .. identifier .. "\nWon't be able to cross-reference this figure.")
517+
-- We've had too many reports of false positives for this, so we're disabling the warning
518+
-- warn("Figure with invalid crossref category: " .. identifier .. "\nWon't be able to cross-reference this figure.")
518519
return nil
519520
end
520521
return quarto.FloatRefTarget({
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: "lightbox no caption"
3+
lightbox: true
4+
format:
5+
html: {}
6+
docx: {}
7+
---
8+
9+
::: {#fig-multi layout-nrow=3}
10+
11+
![](la-palma-map.png){#fig-a}
12+
13+
![](la-palma-map.png){#fig-b}
14+
15+
Captions (a) bala; (b) bala
16+
:::
17+

0 commit comments

Comments
 (0)