Skip to content

fix(validate): refuse a block the block before it takes when written - #32

Merged
plimeor merged 2 commits into
mainfrom
claude/project-thread-656ux2
Oct 18, 2026
Merged

plimeor merged 2 commits into
mainfrom
claude/project-thread-656ux2

Conversation

@plimeor

@plimeor plimeor commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Requested by Plimeor · project thread

Before: validate() checked only a block right after a paragraph in a tight item. Take a tight item holding [paragraph a, tight list [b], paragraph c]. It was written as "- a\n - b\n c\n", and when read back, c became b's lazy line. Other blocks were absorbed the same way: a block after a quote, alert, or footnote that ends in a paragraph; after a table; after a <div>-style HTML block; after a definition; and a quote after a quote. In any container, the block before also took a later block: indented code after indented code or after a footnote definition, and any block after an HTML block its value leaves open (<!-- c). to_markdown returned Markdown that read back as a different tree.

After: validation refuses these shapes. The diagnostic's path is the later block, so Settle's save() writes the item's own tight list loose.

How: validate_blocks checks each adjacent pair through validate_taken_block, which replaces validate_tight_item. The rule follows the parser's own checks:

  • After a nested container or a table, block starts are judged against the matched container, not against the open paragraph.
  • A fence-like line ends a quote's paragraph (chore: release v0.5.0 #19).
  • The walk follows last children only, so it stays linear in the tree.

Only shapes that no source spells are refused, so validation still accepts every document the parser produces. One related shape is left for its own plan, and the spec and the archived plan name it: indented code after a list, where the source marker's width sets the item's content column.

Spec: validation › Shapes that cannot be written. Plan archived at docs/archive/2026-10-18-tight-item-lines/.

Checks run locally: every CI command in CLAUDE.md, including the ci-profile tests, docs, the wasm build, and the node tests.


Generated by Claude Code

A tight item writes each block on the line after the one before. A block
after a nested list, quote, or footnote ending in a paragraph was read back
as that paragraph's lazy line, and one after a table, a blank-line HTML
block, a definition, or a quote was read back inside it. Indented code
after indented code or a footnote definition was read back inside it in
any container. Validation now refuses these shapes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kf5KPnmXitGzqA1hs1txs4
…open, and archive the plan

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kf5KPnmXitGzqA1hs1txs4
@plimeor plimeor self-assigned this Oct 18, 2026
@plimeor
plimeor merged commit 6fef269 into main Oct 18, 2026
2 checks passed
@plimeor
plimeor deleted the claude/project-thread-656ux2 branch October 18, 2026 05:34
@github-actions github-actions Bot mentioned this pull request Oct 18, 2026
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.

2 participants