3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-19 06:35:44 +01:00

Answer architecture round 1: splitTaskList groups a list into items, bulletBlocks returns the split blocks itself, isTaskItem lives in adf/, a property reads generated task lists through portableMarkdownToAdf, and items 56 and 93 name today's code

This commit is contained in:
2026-10-09 14:15:40 +02:00
committed by Lillem4n
parent 3ad1bd504e
commit 2e640ded91
7 changed files with 111 additions and 43 deletions
+5
View File
@@ -1,3 +1,4 @@
import type { AdfNode } from './document.ts'
import type { AttributeVocabulary } from './attribute-vocabulary.ts'
export type BlockNodeModel = {
@@ -88,6 +89,10 @@ export function blockNodeModel(type: string): BlockNodeModel | undefined {
return isBlockType(type) ? blockNodes[type] : undefined
}
export function isTaskItem(node: AdfNode | undefined): boolean {
return node?.type === 'taskItem' || node?.type === 'blockTaskItem'
}
function isBlockType(type: string): type is BlockType {
return Object.hasOwn(blockNodes, type)
}