Commit e6fcf95
feat(revealjs): hoist captioned figure image to section level for auto-stretch
Port Q1's applyStretch figure branch as an AST transform (bd-38ioql41,
Case 1). On a single-image reveal slide, a captioned markdown figure
(`` -> Block::Figure) rendered the stretched
<img class=r-stretch> inside a <figure>, which reveal's
`section > .r-stretch` selector cannot size.
RevealAutoStretchTransform now replaces the Block::Figure with a
Plain[Image] (carrying .r-stretch, with the figure id transferred onto
the img for @fig-id parity) followed by a caption Paragraph whose
trailing Inline::Attr{.caption} makes the writers emit
<p class="caption"> (capability bd-itqcfxc3). Result:
section > img.r-stretch + sibling <p class=caption>, matching Q1 -- all
at the AST level, no DOM postprocessor.
Caption uses <p class=caption> (option c). Centering deferred
(flush-left, consistent with the shipped bare-image case). The
crossref figure case (::: {#fig-id}) stays un-stretched (Option 2A,
deferred): it is a plain Div at auto-stretch time and the crossref
render is excluded from the preview pipeline, so there is no single AST
shape common to render and preview; @fig-id still resolves.
Tests (TDD): 3 unit tests in auto_stretch.rs + 1 render-path test in
revealjs_format.rs (failed first, pass now). Full quarto-core+pampa
suites and cargo xtask verify green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 5a21249 commit e6fcf95
3 files changed
Lines changed: 391 additions & 47 deletions
File tree
- claude-notes/plans
- crates/quarto-core
- src/revealjs
- tests/integration
Lines changed: 57 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
174 | 176 | | |
175 | 177 | | |
176 | 178 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
182 | 232 | | |
183 | 233 | | |
184 | 234 | | |
| |||
0 commit comments