oxidecomputer / oxidecomputer/prettier-plugin-asciidoc
hardBreakOwnsItsLine answers from raw sibling bytes what whitespace row A8 already recorded
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Split from #325, row R2 (verified at main ffdc1860).
The question: does a hard break own its line?
The reader's answer: whitespace row A8 (src/whitespace-fact.ts, beforeHardBreak decided from the node that follows the run; a run holding a newline is bound to newline).
The second answerer: hardBreakOwnsItsLine in src/print/text-edges.ts (l.480), a multi-node walk over raw sibling values with a regex test plus two node-type arms. Four readers: src/print/inline.ts l.399, text-edges.ts l.530, src/print/list-hazard.ts l.245, and its own recursion.
Closes when: the printer reads the recorded row and hardBreakOwnsItsLine is deleted, or a written reason why the recorded row cannot answer at each of the four readers. The deletion goes in scripts/deletions.json; no new recorded fact is expected, so no parity family.
Related: #325 (the catalog), #90 (the class), #307 (row R1, the neighbouring rule).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/whitespace-fact.ts and the recorded beforeHardBreak row, then inspect the four readers in src/print/inline.ts, src/print/text-edges.ts, src/print/list-hazard.ts, and the recursive path in text-edges.ts. Confirm whether the recorded row answers each use, then remove hardBreakOwnsItsLine and record the deletion in scripts/deletions.json, or document why it must remain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100