Move the engine pin past composite figures and cell attributes - #66
Merged
Merged
Conversation
This gem has no parser. ext/carve is a magnus binding over carve-rs, pinned to an exact revision, so a construct the engine gains arrives here when the pin moves and not before. Thirteen corpus documents diverged for that reason alone. Both constructs have landed upstream: markup-carve/carve-rs#986 (PART 9 section 4c, composite figures) and markup-carve/carve-rs#996 (a cell's attributes bind after its kind and alignment markers). The pin moves from 8dada737f608da124e06a1f7e43f962f98a3e68a to 98de7874ad2e81f69e57764562c83f4918522ac2, in ext/carve/Cargo.toml and ext/carve/Cargo.lock together. Measured against carve 1436f39a, extension recompiled each time, 1025 corpus pairs: at 8dada737 13 diverging at 98de7874 0 diverging The thirteen were the nine `318-composite-figures*` documents and the four `319-cell-attributes-*` documents that were failing; all eleven of the former and all six of the latter now match the spec. EXPECTED in test/corpus_ast_types_test.rb gains `figure_group`. That list is a one-directional check: a recorded type going missing fails, a new one only warns, and this run warned. Recording it is what makes the type load-bearing - if a later pin drops the group node, the suite says which type went rather than leaving thirteen documents to explain it. It is a tightening, not a widening: the old pin produced no unrecorded type at all, so this line would have failed the suite before the bump. The control for the clause, `318-composite-figures-8`, asserts that an opener carrying a title or a `[label]` stays a generic container. At the old pin it could not have failed - the engine had no rule separating a bare opener from a decorated one, so both spellings rendered `<div class="figure">`, which is what every diverging bare-opener document showed. At the new pin the mutation that should break it does. Stripping the title and the `[label]` so both openers are bare turns <div class="figure"> <p class="admonition-title">A titled figure div</p> <figure> <img src="a.png" alt="one"> <figcaption>(a) One</figcaption> </figure> </div> <p>^ Not a group caption</p> into <figure class="carve-figure-group"> <div class="carve-figure-panels"> <figure class="carve-figure-panel"> <img src="a.png" alt="one"> <figcaption>(a) One</figcaption> </figure> </div> <figcaption>Not a group caption</figcaption> </figure> Nothing is allowlisted or skipped. The CHANGELOG entries go under the existing Unreleased heading, which already argues from v0.1.0, the only released tag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of markup-carve/carve#1220 (secondary-engine tracker); spec markup-carve/carve#1215, design markup-carve/carve#1122.
There is no port to write here
The tracker's checklist line for this repository reads "port parser/renderers/writer per section 4c", which describes a native engine. This gem is a binding:
ext/carveis magnus over carve-rs, pinned to an exact revision inext/carve/Cargo.tomlwith the lockfile committed beside it. A construct the engine gains arrives here when the pin moves, and no Ruby change reaches it before that.Both constructs have landed upstream: markup-carve/carve-rs#986 (PART 9 section 4c, composite figures) and markup-carve/carve-rs#996 (a cell's attributes bind after its kind and alignment markers).
The change
The pin moves from
8dada737to98de7874(carve-rs main), inext/carve/Cargo.tomlandext/carve/Cargo.lock.EXPECTEDintest/corpus_ast_types_test.rbrecords the newfigure_groupnode type. The rest is the CHANGELOG.Measured
Against carve
1436f39a, extension recompiled for each row, 1025 corpus pairs:8dada737(main)98de7874The 13 were nine
318-composite-figures*documents and four319-cell-attributes-*documents. All eleven318-composite-figuresdocuments and all six319-cell-attributes-bind-after-the-kind-and-alignment-markersdocuments now match the spec. Nothing is allowlisted or skipped; this repository has no allowlist and does not gain one.Proof, both directions
At the old pin,
318-composite-figures-4:rendered the pre-section-4c shape, a generic container with the caret line surviving as a paragraph:
At the new pin it renders what the spec pins, and so do the other twelve.
The control now discriminates
318-composite-figures-8is the control for the clause: an opener carrying a title or a[label]must stay a generic container rather than become a figure group. At the old pin it could not have failed - the engine had no rule separating a bare opener from a decorated one, which the corpus shows directly, since every diverging bare-opener document rendered the same<div class="figure">the control asserts.At the new pin the distinction is real. The document as written:
and with the title and the
[label]stripped, so both openers are bare:Different element, different class, and the caret line is consumed as the group caption.
Why
EXPECTEDgrowscorpus_ast_types_test.rbkeeps a recorded list of node types the corpus produces. The assertion is one-directional by design: a recorded type going missing fails, a new type only warns. This run warned, namingfigure_group.Recording it tightens the check rather than widening it. The old pin produced no unrecorded type at all, so this line would have failed the suite before the bump; from here on, a pin that drops the group node fails with the type named instead of leaving thirteen documents to explain it.
CHANGELOG placement
Both entries go under the existing
Unreleasedheading, which already states that it argues fromv0.1.0- the only released tag, sincev0.1.1is a draft. No version field is touched.