Skip to content

Commit 01604de

Browse files
committed
[backport] Fix conditionalBlock crash in manuscript
Backport from #13624 Add test to reproduce #13616
1 parent 8643d43 commit 01604de

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

src/resources/filters/layout/manuscript.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ function manuscript()
5757
-- If this is a notebook embed cell, 'lift' the contents of any child divs
5858
-- up (unroll their contents), this will help us avoid
5959
-- labeling divs marked as `cells` more than once
60-
local blocks = pandoc.List()
60+
local blocks = pandoc.Blocks({})
6161
for _, childBlock in ipairs(divEl.content) do
6262
if is_regular_node(childBlock, "Div") then
63-
tappend(blocks, childBlock.content)
63+
blocks:extend(childBlock.content)
6464
else
6565
blocks:insert(childBlock)
6666
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.quarto/
2+
**/*.quarto_ipynb
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: "Conditional Block in manuscript article"
3+
_quarto:
4+
tests:
5+
pdf:
6+
noErrors: true
7+
---
8+
9+
::: {.content-visible when-format="pdf"}
10+
11+
Something
12+
13+
:::
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
project:
2+
type: manuscript
3+
4+
manuscript:
5+
article: 13616.qmd
6+
7+
format:
8+
pdf:
9+
pdf-engine: xelatex

0 commit comments

Comments
 (0)