From e3e5532e54b20d04e20269a75a398e6bc9760077 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 25 Mar 2025 15:58:40 +0100 Subject: [PATCH 1/3] avoid cryptic error message because of internal function not handling null value There could be a null value of someone does ```` format: html: null ```` or ```` format: html: ```` This is caught by YAML validation, but validation of YAML could happen after format resolution. --- src/command/render/render-contexts.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/command/render/render-contexts.ts b/src/command/render/render-contexts.ts index 8c7ebb6dbb5..11b4ae5e8bc 100644 --- a/src/command/render/render-contexts.ts +++ b/src/command/render/render-contexts.ts @@ -362,6 +362,7 @@ function mergeQuartoConfigs( // bibliography needs to always be an array so it can be merged const fixupMergeableScalars = (metadata: Metadata) => { + if (metadata === null) return metadata; [ kBibliography, kCss, From f7eccfe6409a59876750a384c5cd6af198facfb1 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 25 Mar 2025 16:01:11 +0100 Subject: [PATCH 2/3] add to changelog --- news/changelog-1.7.md | 1 + 1 file changed, 1 insertion(+) diff --git a/news/changelog-1.7.md b/news/changelog-1.7.md index b52acea8a9f..eab59c74647 100644 --- a/news/changelog-1.7.md +++ b/news/changelog-1.7.md @@ -118,3 +118,4 @@ All changes included in 1.7: - ([#12264](https://github.com/quarto-dev/quarto-cli/issues/12264)): Upgrade `dart-sass` to 1.85.1. - ([#11803](https://github.com/quarto-dev/quarto-cli/pull/11803)): Added a new CLI command `quarto call`. First users of this interface are the new `quarto call engine julia ...` subcommands. - A new folder `quarto-session-temp` can be created in `.quarto` to store temporary files created by Quarto during a rendering. Reminder: `.quarto` is for internal use of Quarto and should not be versioned (thus added to `.gitignore`). +- ([#12369](https://github.com/quarto-dev/quarto-cli/pull/12369)): `quarto preview` correctly throws a YAML validation error when a `format` key does not conform. From 4f458a01878a9d6ac5fbb5f9521eba32c073497b Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Mon, 31 Mar 2025 15:00:43 -0400 Subject: [PATCH 3/3] add comment --- src/command/render/render-contexts.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/command/render/render-contexts.ts b/src/command/render/render-contexts.ts index 11b4ae5e8bc..abe83d97e27 100644 --- a/src/command/render/render-contexts.ts +++ b/src/command/render/render-contexts.ts @@ -362,6 +362,10 @@ function mergeQuartoConfigs( // bibliography needs to always be an array so it can be merged const fixupMergeableScalars = (metadata: Metadata) => { + // see https://github.com/quarto-dev/quarto-cli/pull/12372 + // and https://github.com/quarto-dev/quarto-cli/pull/12369 + // for more details on why we need this check, as a consequence of an unintuitive + // ordering of YAML validation operations if (metadata === null) return metadata; [ kBibliography,