Skip to content

Commit ca05876

Browse files
authored
Merge pull request #11999 from quarto-dev/layout-panel/empty-preamble
2 parents 0c92ce4 + e69944b commit ca05876

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

news/changelog-1.7.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ All changes included in 1.7:
4545
- ([#11578](https://github.com/quarto-dev/quarto-cli/issues/11578)): Typst column layout widths use fractional `fr` units instead of percent `%` units for unitless and default widths in order to fill the enclosing block and not spill outside it.
4646
- ([#11676](https://github.com/quarto-dev/quarto-cli/pull/11676)): Convert unitless image widths from pixels to inches for column layouts.
4747
- ([#11835](https://github.com/quarto-dev/quarto-cli/issues/11835)): Take markdown structure into account when detecting minimum heading level.
48+
- ([#11964](https://github.com/quarto-dev/quarto-cli/issues/11964)): Using panel layout without a crossref label now correctly do not add an empty `#block[]` that was leading to an unnecessary space in output.
4849

4950
## Lua Filters and extensions
5051

src/resources/filters/customnodes/panellayout.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ _quarto.ast.add_handler({
7676
tbl.attributes = as_plain_table(tbl.attr.attributes)
7777
tbl.attr = nil
7878
end
79-
tbl.preamble = pandoc.Div(tbl.preamble)
79+
tbl.preamble = not _quarto.utils.is_empty_node(tbl.preamble) and pandoc.Div(tbl.preamble) or nil
8080
end
8181
-- compute vertical alignment and remove attribute
8282
if tbl.attributes == nil then
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: No empty preamble in layout panel
3+
format:
4+
html: default
5+
typst:
6+
keep-typ: true
7+
_quarto:
8+
tests:
9+
html:
10+
ensureFileRegexMatches:
11+
- []
12+
- ['<div>\s*</div>\s*<div class="quarto-layout-panel"']
13+
typst:
14+
ensureTypstFileRegexMatches:
15+
- []
16+
- ['#block\[\s*\]']
17+
---
18+
19+
:::{layout-ncol=2}
20+
21+
Test 1
22+
23+
Test 2
24+
25+
:::

0 commit comments

Comments
 (0)