Skip to content

Commit c5090ea

Browse files
committed
test: move issue-14575 case docs from YAML into test body
1 parent 58a3944 commit c5090ea

2 files changed

Lines changed: 26 additions & 32 deletions

File tree

tests/docs/smoke-all/2026/06/30/14575-knitr.qmd

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
---
2-
# Issue #14575 (knitr engine cases). With tbl-cap-location: bottom, a
3-
# cross-referenced knitr/kable table (wrapped by Quarto in
4-
# .cell-output-display) places its caption inside the longtable body
5-
# instead of the foot.
6-
#
7-
# Correct behaviour: \caption{...}\tabularnewline immediately before
8-
# \endlastfoot.
9-
#
10-
# Case 7 is the reported bug (currently fails; should pass after fix).
11-
# Case 8 already renders correctly (regression guard).
12-
#
13-
# The kable(longtable = TRUE, caption = ...) variant (no \endlastfoot
14-
# in kable's own \hline longtable) is tracked separately.
2+
# Issue #14575 — knitr engine cases. See the body below for details.
153
format: pdf
164
tbl-cap-location: bottom
175
keep-tex: true
@@ -22,12 +10,23 @@ _quarto:
2210
ensureLatexFileRegexMatches:
2311
-
2412
- '\\end\{document\}'
25-
# Case 7: knitr kable with label + tbl-cap (the reported bug)
2613
- '\\caption\{[\s\S]{0,60}CAP7 caption[\s\S]{0,60}\\tabularnewline\s*\\endlastfoot'
27-
# Case 8: knitr kable with tbl-cap, no label (guard)
2814
- '\\caption\{[\s\S]{0,60}CAP8 caption[\s\S]{0,60}\\tabularnewline\s*\\endlastfoot'
2915
---
3016

17+
With `tbl-cap-location: bottom`, a knitr `kable()` table that Quarto wraps in
18+
`.cell-output-display` must place its bottom caption in the longtable foot —
19+
`\caption{...}\tabularnewline` immediately before `\endlastfoot` — not inside
20+
the table body. Both assertions above check that placement.
21+
22+
Case 7 is the reported bug (cross-referenced kable with a label); it passes
23+
only after the fix. Case 8 (kable with a caption but no label) already
24+
rendered correctly and acts as a regression guard.
25+
26+
The `kable(longtable = TRUE, caption = ...)` variant is a different shape —
27+
its longtable has no `\endlastfoot`, so the caption is orphaned — and is
28+
tracked separately, out of scope here.
29+
3130
# Case 7: knitr kable with label (reported bug)
3231

3332
```{r}

tests/docs/smoke-all/2026/06/30/14575.qmd

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
---
2-
# Issue #14575: with tbl-cap-location: bottom, the caption of a
3-
# cross-referenceable table whose content is wrapped in
4-
# .cell-output-display (knitr/jupyter engine output) is placed inside
5-
# the longtable body instead of in the foot (\endlastfoot).
6-
#
7-
# This file covers the markdown-only cases (CI-safe, no engine needed).
8-
# Correct behaviour: the bottom caption sits in the longtable foot,
9-
# i.e. \caption{...}\tabularnewline immediately before \endlastfoot.
10-
#
11-
# Cases 1-4 already render correctly (regression guards).
12-
# Cases 5-6 are the bug (currently fail; should pass after the fix).
2+
# Issue #14575 — markdown-only cases (CI-safe, no engine needed).
3+
# See the body below for what each case exercises.
134
format: pdf
145
tbl-cap-location: bottom
156
keep-tex: true
@@ -20,20 +11,24 @@ _quarto:
2011
ensureLatexFileRegexMatches:
2112
-
2213
- '\\end\{document\}'
23-
# Case 1: markdown table + caption syntax, no id (guard)
2414
- '\\caption\{[\s\S]{0,60}CAP1 caption[\s\S]{0,60}\\tabularnewline\s*\\endlastfoot'
25-
# Case 2: markdown table + caption syntax + id (guard)
2615
- '\\caption\{[\s\S]{0,60}CAP2 caption[\s\S]{0,60}\\tabularnewline\s*\\endlastfoot'
27-
# Case 3: div float + bare table + trailing caption paragraph (guard)
2816
- '\\caption\{[\s\S]{0,60}CAP3 caption[\s\S]{0,60}\\tabularnewline\s*\\endlastfoot'
29-
# Case 4: div float + tbl-cap attribute + bare table (guard)
3017
- '\\caption\{[\s\S]{0,60}CAP4 caption[\s\S]{0,60}\\tabularnewline\s*\\endlastfoot'
31-
# Case 5: div float + tbl-cap + .cell-output-display (the bug)
3218
- '\\caption\{[\s\S]{0,60}CAP5 caption[\s\S]{0,60}\\tabularnewline\s*\\endlastfoot'
33-
# Case 6: .cell + .cell-output-display, mcanouil reprex (the bug)
3419
- '\\caption\{[\s\S]{0,60}CAP6 caption[\s\S]{0,60}\\tabularnewline\s*\\endlastfoot'
3520
---
3621

22+
With `tbl-cap-location: bottom`, a cross-referenceable table's bottom caption
23+
must land in the longtable foot — `\caption{...}\tabularnewline` immediately
24+
before `\endlastfoot` — not after the data rows inside the table body. Each
25+
`CAPn caption` assertion above checks that placement for one input shape.
26+
27+
Cases 1–4 already rendered correctly before the fix and act as regression
28+
guards. Cases 5–6 wrap the table in a `.cell-output-display` Div (the shape
29+
Quarto produces for knitr/Jupyter output); these triggered the bug and pass
30+
only after the fix.
31+
3732
# Case 1: markdown table, caption syntax, no id
3833

3934
| speed| dist|

0 commit comments

Comments
 (0)