mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
add orphan prevention tests
This commit is contained in:
parent
e0bfe90e12
commit
3ae46a94cd
BIN
tests/ref/grid-header-non-repeating-orphan-prevention.png
Normal file
BIN
tests/ref/grid-header-non-repeating-orphan-prevention.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 453 B |
BIN
tests/ref/grid-subheaders-non-repeating-orphan-prevention.png
Normal file
BIN
tests/ref/grid-subheaders-non-repeating-orphan-prevention.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 347 B |
Binary file not shown.
Before Width: | Height: | Size: 754 B After Width: | Height: | Size: 795 B |
BIN
tests/ref/grid-subheaders-repeating-orphan-prevention.png
Normal file
BIN
tests/ref/grid-subheaders-repeating-orphan-prevention.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 347 B |
BIN
tests/ref/grid-subheaders-short-lived-no-orphan-prevention.png
Normal file
BIN
tests/ref/grid-subheaders-short-lived-no-orphan-prevention.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 287 B |
@ -250,6 +250,17 @@
|
||||
..([Test], [Test], [Test]) * 20
|
||||
)
|
||||
|
||||
--- grid-header-non-repeating-orphan-prevention ---
|
||||
#set page(height: 5em)
|
||||
#v(2em)
|
||||
#grid(
|
||||
grid.header(repeat: false)[*Abc*],
|
||||
[a],
|
||||
[b],
|
||||
[c],
|
||||
[d]
|
||||
)
|
||||
|
||||
--- grid-header-empty ---
|
||||
// Empty header should just be a repeated blank row
|
||||
#set page(height: 12em)
|
||||
|
@ -197,6 +197,8 @@
|
||||
)
|
||||
|
||||
--- grid-subheaders-repeat-replace-short-lived ---
|
||||
// No orphan prevention for short-lived headers
|
||||
// (followed by replacing headers).
|
||||
#set page(height: 8em)
|
||||
#grid(
|
||||
grid.header(
|
||||
@ -345,6 +347,56 @@
|
||||
grid.cell(x: 0)[done.]
|
||||
)
|
||||
|
||||
--- grid-subheaders-short-lived-no-orphan-prevention ---
|
||||
// No orphan prevention for short-lived headers.
|
||||
#set page(height: 8em)
|
||||
#v(5em)
|
||||
#grid(
|
||||
grid.header(
|
||||
level: 2,
|
||||
[b]
|
||||
),
|
||||
grid.header(
|
||||
level: 2,
|
||||
[c]
|
||||
),
|
||||
[d]
|
||||
)
|
||||
|
||||
--- grid-subheaders-repeating-orphan-prevention ---
|
||||
#set page(height: 8em)
|
||||
#v(4.5em)
|
||||
#grid(
|
||||
grid.header(
|
||||
repeat: true,
|
||||
level: 2,
|
||||
[L2]
|
||||
),
|
||||
grid.header(
|
||||
repeat: true,
|
||||
level: 4,
|
||||
[L4]
|
||||
),
|
||||
[a]
|
||||
)
|
||||
|
||||
--- grid-subheaders-non-repeating-orphan-prevention ---
|
||||
#set page(height: 8em)
|
||||
#v(4.5em)
|
||||
#grid(
|
||||
grid.header(
|
||||
repeat: false,
|
||||
level: 2,
|
||||
[L2]
|
||||
),
|
||||
grid.header(
|
||||
repeat: false,
|
||||
level: 4,
|
||||
[L4]
|
||||
),
|
||||
[a]
|
||||
)
|
||||
|
||||
--- grid-subheaders-alone ---
|
||||
#table(
|
||||
table.header(
|
||||
|
Loading…
x
Reference in New Issue
Block a user