From 2bf8e372837c9ff16f92b2c3ea6b3cb4389ca330 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Mon, 9 Nov 2026 08:28:13 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20prose=20round=201:=200=20=F0=9F=94=B4,?= =?UTF-8?q?=201=20=F0=9F=9F=A1=20(0=20misread);=20move=20the=20taskBlocks?= =?UTF-8?q?=20comment=20to=20the=20branch=20it=20governs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/markdown/portable/block-spelling.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/markdown/portable/block-spelling.ts b/src/markdown/portable/block-spelling.ts index 665d14b..ff3dda2 100644 --- a/src/markdown/portable/block-spelling.ts +++ b/src/markdown/portable/block-spelling.ts @@ -65,7 +65,6 @@ function placedBlock(node: AdfNode, path: ConvertErrorPath, depth: number, writi return block.ok ? success({ blocks: [{ ...block.value, node }], headroom: block.value.headroom }) : block } -// A block task item reaches here holding two or more paragraphs, so the marker leads the first (`itemParts` in task-list.ts). function taskBlocks(task: AdfNode, path: ConvertErrorPath, depth: number, writing: Writing): Result { const marker = taskMarker(nodeAttrs(task)['state']) if (task.type === 'taskItem') { @@ -74,6 +73,7 @@ function taskBlocks(task: AdfNode, path: ConvertErrorPath, depth: number, writin if (!line.ok) return line return success({ blocks: [{ node: { type: 'paragraph' }, spelling: 'commonmark', text: blockText(line.value === '' ? marker : `${marker} ${line.value}`) }], headroom: Number.POSITIVE_INFINITY }) } + // `itemParts` in task-list.ts leaves a block task item holding only paragraphs, two or more, so the marker leads the first. const walk = walkBlocks(nodeContent(task), path, depth, writing) if (!walk.ok) return walk const blocks = walk.value.blocks.map((block, index) => (index === 0 ? { ...block, text: prefixedText(`${marker} `, '', block.text) } : block))