diff --git a/src/markdown/emit/unspellable-runs.test.ts b/src/markdown/emit/unspellable-runs.test.ts index 843b48e..4a2fadc 100644 --- a/src/markdown/emit/unspellable-runs.test.ts +++ b/src/markdown/emit/unspellable-runs.test.ts @@ -75,6 +75,12 @@ const lines: { carry?: string[]; drop?: string[]; name: string; nodes: AdfNode[] name: 'a word, strong over nodes 1 and 2, em on node 2, a word after', nodes: [plain('b'), marked(['strong'], '(a'), marked(['strong', 'em'], ')'), plain('c')], }, + { + carry: ['em@2-2'], + drop: ['em@2-2'], + name: 'a digit, strong and strike over nodes 1 and 2, em on node 2, strong on a digit', + nodes: [plain('0'), marked(['strong', 'strike'], '_'), marked(['strong', 'em', 'strike'], '_'), marked(['strong'], '0')], + }, ] for (const { carry, drop, name, nodes } of lines) { diff --git a/src/markdown/emit/unspellable-runs.ts b/src/markdown/emit/unspellable-runs.ts index 925d3e4..79b615c 100644 --- a/src/markdown/emit/unspellable-runs.ts +++ b/src/markdown/emit/unspellable-runs.ts @@ -166,6 +166,7 @@ function mayFlank(sweep: PairSweep, judged: number, character: string, end: 'clo function runEdge(sweep: PairSweep, judged: number, from: number, step: -1 | 1, character: string): string[] | undefined { const found: string[] = [] const { delimiters } = touching(sweep, from, step) + // Each pair beside adds the characters it may be written with; one that stands ends the run unless it may be written with `character`. for (const at of delimiters) { const other = sweep.pairAt[at] ?? -1 const standing = pairStanding(sweep, judged, other) diff --git a/todo.md b/todo.md index fe21883..9ea60a8 100644 --- a/todo.md +++ b/todo.md @@ -13,7 +13,6 @@ | ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score | |---|---|---|---|---|---|---|---|---|---|---|---| | 153 | 0.4.0 | | question | **Decide whether `src/markdown/` root may import `emit/`, `parse/` or `portable/`, and hold the answer in `.oxlintrc.json` and §The source parts by ADF and format.** | 1 | 2 | 2 | 3 | 2 | code health by 3 | 26.2 | -| 176 | 0.4.0 | | | **Delete `runEdge`'s `standing === 'moves'` give-up, and any code only it needs, once a test or an argument shows `runEdge` never reaches it, or else pin the case with a hand-worked line.** | 1 | 1 | 2 | 2 | 2 | code health by 2 | 17.4 | | 45 | 0.4.0 | | defect | **Replace `isAdfDocument` with a reader returning `Result`.** | 2 | 1 | 3 | 4 | 3 | 1 by 2 | 13.1 | | 127 | 0.4.0 | | principle | **Hold what `entity-references.test.ts`, `json-text.test.ts` and `result.test.ts` check by asserting outcomes, so none reads source text.** | 2 | 2 | 1 | 3 | 3 | code health by 2 | 13.1 | | 159 | 0.4.0 | | | **Delete `taskBlocks`'s branch that writes the task marker as its own paragraph, once a test shows no block task item reaches it.** | 1 | 1 | 1 | 1 | 1 | code health by 1 | 10.5 | @@ -71,13 +70,6 @@ a paragraph opening with a spellable `!adf:link` (§Nothing recurses unbounded). `src/markdown/**` bans only `html/`; banning `emit/`, `parse/` and `portable/` for the root's own files, with its `ci.sh` probe, extends the decision. -### 176. Delete `runEdge`'s `standing === 'moves'` give-up, and any code only it needs, once a test or an argument shows `runEdge` never reaches it, or else pin the case with a hand-worked line. - -In `src/markdown/emit/unspellable-runs.ts`, Stryker's mutants of `runEdge`'s -`if (standing === 'moves') return undefined` survive the hand-worked tests, and 50,000 fuzz runs -comparing the code with the mutant found no output differ. Found on PR 145, 2026-11-09. The -comprehension seats found `runEdge` hard to read (`larv-review places`); make it easier. - ### 45. Replace `isAdfDocument` with a reader returning `Result`. Lands with item 77: the reader returns item 77's copy. Goal 1 has every call return a result; the