From 31576bb8249a9eb03fa73ffe3fe14f8a057f802a Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sat, 3 Oct 2026 14:41:42 +0200 Subject: [PATCH] Take the raw run's refusal path only where its code matches the editor-normal refusal --- src/markdown/emit/plain-reduction.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/markdown/emit/plain-reduction.ts b/src/markdown/emit/plain-reduction.ts index 055e7e1..00883e0 100644 --- a/src/markdown/emit/plain-reduction.ts +++ b/src/markdown/emit/plain-reduction.ts @@ -54,9 +54,9 @@ export function reduceToPlain(document: AdfDocument): Result { // docs/decisions.md §Equality is deep: the reduction reads and writes editor-normal ADF. const blocks = reduceBlocks(nodeContent(toEditorNormal(document)), { depth: 0, memo: new Map(), path: [] }) if (!blocks.ok) { - // Merging text renumbers siblings, so the caller's document names the refusal's path. + // Merging text renumbers siblings, so the caller's document names the path of the refusal the editor-normal one meets. const raw = reduceBlocks(nodeContent(document), { depth: 0, memo: new Map(), path: [] }) - return raw.ok ? blocks : raw + return !raw.ok && raw.error.code === blocks.error.code ? raw : blocks } return success({ content: nodeContent(toEditorNormal({ content: blocks.value, type: 'doc', version: 1 })).slice(), type: 'doc', version: 1 }) }