Skip to content

The composite figure drops its panels wrapper - #1306

Merged
dereuromark merged 1 commit into
mainfrom
feat/figure-group-flat
Aug 16, 2026
Merged

The composite figure drops its panels wrapper#1306
dereuromark merged 1 commit into
mainfrom
feat/figure-group-flat

Conversation

@dereuromark

Copy link
Copy Markdown
Contributor

Part of markup-carve/carve#1122; spec: markup-carve/carve#1241 (merged as 427b125).

The maintainer-ruled rendering revision before any release carries the composite-figure shape: the <div class="carve-figure-panels"> wrapper is dropped. Panels and preserved stray content nest DIRECTLY inside <figure class="carve-figure-group">, one indent level up, the group <figcaption> stays last, and carve-figure-panel stays on each panel.

Rationale: HTML's content model for figure is one figcaption first-or-last plus flow content, and a figure is itself flow content - the wrapper drew a box the element already provides, and .carve-figure-group > .carve-figure-panel selects panels exactly as the div did. Pandoc's subfigure HTML output has the same flat shape.

  • HtmlRenderer: renderFigureGroup emits the flat shape. An empty uncaptioned group keeps the bare-container empty-body form (the PART 10 §4 exception the bare div takes, matching the oracle), now pinned by a unit test; an empty captioned group holds only its figcaption.
  • HtmlToCarve: own-output import reads the flat shape - direct figure.carve-figure-panel children are panels, other direct children are stray content, and the direct-child figcaption is the group caption (a panel's caption sits inside the panel figure, so the scan cannot confuse the two).
  • Spec pin: tests/spec moves to 427b125 (merged spec: a figure group's panels nest directly, and the wrapper div goes carve#1241), whose corpus pins the flat bytes; all eleven 318-composite-figures documents pass byte for byte, and the fmt corpus stays green with no exclusions.

No AST, fmt, or degradation-target changes: the wrapper existed only in the HTML target, so figure_group on the wire, the canonical writer, and the Markdown/plain/ANSI spellings are untouched.

PART 9 section 4c revision (markup-carve/carve#1122), ruled before any release
carries the shape. The `<div class="carve-figure-panels">` wrapper is gone:
panels and preserved stray content nest DIRECTLY inside
`<figure class="carve-figure-group">`, one indent level up, with the group's
`<figcaption>` last and `carve-figure-panel` unchanged on each panel.

HTML's content model for `figure` is one `figcaption` first-or-last plus flow
content, and a `figure` is itself flow content - so the wrapper drew a box the
element already provides, and a consumer styling the group can select
`.carve-figure-group > .carve-figure-panel` exactly as it could select the
div. Pandoc's subfigure HTML output has the same flat shape, which the sibling
engines match byte for byte through the shared corpus.

The HTML importer reads the flat shape back: panels are the direct
`figure.carve-figure-panel` children of the group and the group caption is the
direct `figcaption` child - a panel's own caption sits inside the panel
figure, so the direct-child scan never confuses the two. An empty uncaptioned
group keeps the bare-container empty-body form - the PART 10 section 4
exception the bare div takes, and the shape the oracle emits.

The tests/spec submodule pin moves to 427b125 on spec main, the merged
markup-carve/carve#1241, whose corpus pins the flat bytes; all eleven
318-composite-figures documents pass byte for byte.
@dereuromark dereuromark added the enhancement New feature or request label Aug 16, 2026
@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@dereuromark
dereuromark merged commit 90104a9 into main Aug 16, 2026
6 checks passed
@dereuromark
dereuromark deleted the feat/figure-group-flat branch August 16, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant