mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-20 15:15:44 +01:00
Answer architecture round 3: taskBlocks drops the spelling guard no paragraph needs
This commit is contained in:
@@ -209,7 +209,7 @@ function taskBlocks(task: AdfNode, path: ConvertErrorPath, depth: number, writin
|
|||||||
const walk = walkBlocks(nodeContent(task), path, depth, writing)
|
const walk = walkBlocks(nodeContent(task), path, depth, writing)
|
||||||
if (!walk.ok) return walk
|
if (!walk.ok) return walk
|
||||||
const [first, ...rest] = walk.value.blocks
|
const [first, ...rest] = walk.value.blocks
|
||||||
const blocks = first?.node.type === 'paragraph' && first.spelling !== 'list' ? [{ ...first, text: `${marker} ${first.text}` }, ...rest] : [markerBlock, ...walk.value.blocks]
|
const blocks = first?.node.type === 'paragraph' ? [{ ...first, text: `${marker} ${first.text}` }, ...rest] : [markerBlock, ...walk.value.blocks]
|
||||||
return success({ blocks, headroom: walk.value.headroom })
|
return success({ blocks, headroom: walk.value.headroom })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user