oxidecomputer / oxidecomputer/prettier-plugin-asciidoc

Reflow joins two source lines and the join changes how the rest of the block is read

Open
#57 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

foundation mechanism:reflow-join obligation:meaning-preservation reflow-hazard tier-1
Dominant language
TypeScript
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Tier 1 (formatting corrupts output). Measured at 14e23234.

Reflow joins two source lines that Asciidoctor keeps apart, and the join changes how the LINES AFTER IT are read. Two faces.

Face 1 — the item's principal text
input:  "* a\nX\n// c\n+\npara\n** b\n"
output: "* a X\n// c\n+\npara\n** b\n"

render(input):  <li><p>a X</p><div class="paragraph"><p>para ** b</p></div></li>
render(output): <li><p>a X</p><div class="paragraph"><p>para</p></div>
                <div class="ulist"><ul><li><p>b</p></li></ul></div></li>

Every byte from // c onward is identical in both. Only the principal text's line break is gone — and with it Asciidoctor's reading of the +-attached block: ** b folds into the attached paragraph before the join and starts a nested list after it. Dropping either ingredient makes it render-equal ("* a\nX\n+\npara\n** b\n" without the comment line, "* a\n// c\n+\npara\n** b\n" without the join), so both are load-bearing.

Face 2 — a block title, and the block under it
input:  "* a\n[role]\npara\n[[anc]]\n.T\npara\n"
output: "* a\n[role]\npara\n[[anc]]\n.T para\n"

render(input):  …<div id="anc" class="paragraph"><div class="title">T</div><p>para</p></div>
render(output): the item has no attached block at all

The .T block-title line is reflowed onto the paragraph it titles. .T para is then a title with nothing under it, and the whole anchored paragraph — title AND text — disappears from the rendering. This face LOSES CONTENT rather than reshaping it.

5 of the 158 shapes on the deep sweep's allowlist fail for this reason (4 of face 1, 1 of face 2). Pinned by the deep sweep's allowlist (tests/format/list-shape-allowlist.ts, family reflow-join-changes-reading); run it with bun run sweep:deep.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/format/list-shape-allowlist.ts and the reflow-join-changes-reading family, then run the listed allowlist with bun run sweep:deep. Compare the five failing shapes against the input and rendered-output examples; done means those shapes no longer change how later lines are read or lose the anchored block.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, typescript
Domain
testing, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.