3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-20 07:05:44 +01:00

21 - the table's row is the node's model, never the node

This commit is contained in:
2026-09-21 21:45:11 +02:00
parent 2e7eb0501b
commit fb48a5da6b
14 changed files with 96 additions and 84 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
import type { AttributeVocabulary } from './attribute-vocabulary.ts'
export type BlockNode = {
export type BlockNodeModel = {
attributes: AttributeVocabulary
contentModel: 'block' | 'code' | 'inline' | 'none'
}
@@ -80,11 +80,11 @@ export const blockNodes = {
tableRow: { attributes: localIdAttributes, contentModel: 'block' },
taskItem: { attributes: localIdAttributes, contentModel: 'inline' },
taskList: { attributes: localIdAttributes, contentModel: 'block' },
} satisfies Readonly<Record<string, BlockNode>>
} satisfies Readonly<Record<string, BlockNodeModel>>
export type BlockType = keyof typeof blockNodes
export function blockNodeNamed(type: string): BlockNode | undefined {
export function blockNodeModel(type: string): BlockNodeModel | undefined {
return isBlockType(type) ? blockNodes[type] : undefined
}