From b116724bd61f63caf045b7eaa86435c10addff9a Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 28 Oct 2025 11:42:17 +0100 Subject: [PATCH 1/4] Add test to reproduce #13616 --- tests/docs/smoke-all/2025/10/27/13616/13616.qmd | 15 +++++++++++++++ tests/docs/smoke-all/2025/10/27/13616/_quarto.yml | 9 +++++++++ 2 files changed, 24 insertions(+) create mode 100644 tests/docs/smoke-all/2025/10/27/13616/13616.qmd create mode 100644 tests/docs/smoke-all/2025/10/27/13616/_quarto.yml diff --git a/tests/docs/smoke-all/2025/10/27/13616/13616.qmd b/tests/docs/smoke-all/2025/10/27/13616/13616.qmd new file mode 100644 index 00000000000..fc91c333596 --- /dev/null +++ b/tests/docs/smoke-all/2025/10/27/13616/13616.qmd @@ -0,0 +1,15 @@ +--- +title: "Raw tex in content-visible div (#13616)" +_quarto: + tests: + pdf: + noErrors: true +--- + +::: {.content-visible when-format="pdf"} + +```{=tex} +\textbf{Hello World} +``` + +::: diff --git a/tests/docs/smoke-all/2025/10/27/13616/_quarto.yml b/tests/docs/smoke-all/2025/10/27/13616/_quarto.yml new file mode 100644 index 00000000000..2539ccd82a5 --- /dev/null +++ b/tests/docs/smoke-all/2025/10/27/13616/_quarto.yml @@ -0,0 +1,9 @@ +project: + type: manuscript + +manuscript: + article: 13616.qmd + +format: + pdf: + pdf-engine: xelatex From be01d20bd31812e4a3a3017d8084779f75334dcc Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 28 Oct 2025 17:13:30 +0100 Subject: [PATCH 2/4] Fix ConditionalBlock crash in manuscript projects In manuscript.lua, using pandoc.List() to build block collections and assigning to divEl.content changed the content type from "Blocks" to "List". When ConditionalBlock returned el.content, it returned a List without a .walk() method, causing crashes during AST traversal. Changed to pandoc.Blocks({}) to maintain proper type throughout the filter chain. Fixes #13616 --- src/resources/filters/layout/manuscript.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resources/filters/layout/manuscript.lua b/src/resources/filters/layout/manuscript.lua index a0a3f18cc40..ab21d42e138 100644 --- a/src/resources/filters/layout/manuscript.lua +++ b/src/resources/filters/layout/manuscript.lua @@ -57,10 +57,10 @@ function manuscript() -- If this is a notebook embed cell, 'lift' the contents of any child divs -- up (unroll their contents), this will help us avoid -- labeling divs marked as `cells` more than once - local blocks = pandoc.List() + local blocks = pandoc.Blocks({}) for _, childBlock in ipairs(divEl.content) do if is_regular_node(childBlock, "Div") then - tappend(blocks, childBlock.content) + blocks:extend(childBlock.content) else blocks:insert(childBlock) end From e55030c9a1eb21088842aebcd3d1ea25c71464f0 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 28 Oct 2025 17:13:57 +0100 Subject: [PATCH 3/4] use simpler version of the test as it has nothing to do with RawBlocks --- tests/docs/smoke-all/2025/10/27/13616/.gitignore | 2 ++ tests/docs/smoke-all/2025/10/27/13616/13616.qmd | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 tests/docs/smoke-all/2025/10/27/13616/.gitignore diff --git a/tests/docs/smoke-all/2025/10/27/13616/.gitignore b/tests/docs/smoke-all/2025/10/27/13616/.gitignore new file mode 100644 index 00000000000..ad293093b07 --- /dev/null +++ b/tests/docs/smoke-all/2025/10/27/13616/.gitignore @@ -0,0 +1,2 @@ +/.quarto/ +**/*.quarto_ipynb diff --git a/tests/docs/smoke-all/2025/10/27/13616/13616.qmd b/tests/docs/smoke-all/2025/10/27/13616/13616.qmd index fc91c333596..85e7938dae9 100644 --- a/tests/docs/smoke-all/2025/10/27/13616/13616.qmd +++ b/tests/docs/smoke-all/2025/10/27/13616/13616.qmd @@ -1,5 +1,5 @@ --- -title: "Raw tex in content-visible div (#13616)" +title: "Conditional Block in manuscript article" _quarto: tests: pdf: @@ -8,8 +8,6 @@ _quarto: ::: {.content-visible when-format="pdf"} -```{=tex} -\textbf{Hello World} -``` +Something ::: From 2a92052d8abae1849de35570afbe48daf6beca08 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Wed, 12 Nov 2025 11:51:40 +0100 Subject: [PATCH 4/4] Add changelog entry as regression fix [skip ci] --- news/changelog-1.9.md | 1 + 1 file changed, 1 insertion(+) diff --git a/news/changelog-1.9.md b/news/changelog-1.9.md index e409e9a3b33..be96d684a8c 100644 --- a/news/changelog-1.9.md +++ b/news/changelog-1.9.md @@ -6,6 +6,7 @@ All changes included in 1.9: - ([#13441](https://github.com/quarto-dev/quarto-cli/pull/13441)): Catch `undefined` exceptions in Pandoc failure to avoid spurious error message. - ([#13046](https://github.com/quarto-dev/quarto-cli/issues/13046)): Use new url for multiplex socket.io server as default for `format: revealjs` and `revealjs.multiplex: true`. - ([#13506](https://github.com/quarto-dev/quarto-cli/issues/13506)): Fix navbar active state detection when sidebar has no logo configured. Prevents empty logo links from interfering with navigation highlighting. +- ([#13616](https://github.com/quarto-dev/quarto-cli/issues/13616)): Fix fatal error when rendering manuscript projects with custom blocks like ConditionalBlock. - ([#13625](https://github.com/quarto-dev/quarto-cli/issues/13625)): Fix Windows file locking error (os error 32) when rendering with `--output-dir` flag. Context cleanup now happens before removing the temporary `.quarto` directory, ensuring file handles are properly closed. - ([#13633](https://github.com/quarto-dev/quarto-cli/issues/13633)): Fix detection and auto-installation of babel language packages from newer error format that doesn't explicitly mention `.ldf` filename.