Skip to content

Re-vendor carve-lib + block-attribute corpus + grammar precision - #26

Merged
dereuromark merged 1 commit into
mainfrom
chore/block-attr-revendor
May 21, 2026
Merged

Re-vendor carve-lib + block-attribute corpus + grammar precision#26
dereuromark merged 1 commit into
mainfrom
chore/block-attr-revendor

Conversation

@dereuromark

Copy link
Copy Markdown
Contributor

Completes the block-attribute-line rollout on the carve side (PART 9 §15, spec #25; carve-js carve-js#22; carve-php already conformant).

  • carve-lib re-vendored from carve-js main (block-attr parser + per-block-type attr rendering).
  • examples.md + corpus — three new Attributes fixtures: 17-attributes-2 (single attr line → paragraph), -3 (consecutive class accumulation), -4 (attrs on a list). All class-focused so they agree byte-for-byte across carve-js AND carve-php (verified); they deliberately avoid the separate multi-attribute render-order divergence (carve-js class id key vs carve-php id class key), tracked separately.
  • grammar.ebnf — tightens block_attributes to match both reference impls: a continuation is a single line break (+indent), and a blank line inside the braces ends the block (not interior padding). The earlier ws_nl form over-claimed blank-line support neither impl provides. Adds §15 notes on the blank-line and quoted-}-across-lines (pathological) edges.

93/93 corpus + normativity pass.

Codex flagged that a {...} line after paragraph text (no blank) doesn't attach to the following block. Verified false positive: neither djot-php nor carve-php attaches it either — both drop it. Making {...} a paragraph-breaker would make carve-js diverge from the reference on Para\n{.note}\nNext (which the reference joins into one paragraph). The §15 feature targets leading attribute lines; the mid-prose case matches the reference in dropping the attr.

Completes the block-attribute-line rollout on the carve side (PART 9
§15, spec #25; carve-js renderer carve-js#22; carve-php already
conformant).

- docs/.vitepress/carve-lib: re-vendored from carve-js main (block-attr
  parser + per-block-type attr rendering).
- docs/examples.md + corpus: three new Attributes fixtures --
  17-attributes-2 (single attr line -> paragraph), -3 (consecutive
  class accumulation), -4 (attrs on a list). All class-focused so they
  agree byte-for-byte across carve-js AND carve-php (verified); they
  avoid the separate multi-attribute render-ORDER divergence (carve-js
  class/id/key vs carve-php id/class/key), tracked separately.
- resources/grammar.ebnf: tightens block_attributes to match BOTH
  reference impls -- a continuation is a single line break (+indent),
  and a BLANK line inside the braces ends the block (not interior
  padding). The earlier ws_nl form over-claimed blank-line support that
  neither carve-js nor carve-php implements. Adds §15 notes on the
  blank-line and quoted-} -across-lines (pathological, unsupported)
  edges.

93/93 corpus + normativity tests pass.
@dereuromark
dereuromark merged commit 11699e7 into main May 21, 2026
2 checks passed
@dereuromark
dereuromark deleted the chore/block-attr-revendor branch May 21, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant