3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-19 14:45: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
+4 -4
View File
@@ -1,9 +1,9 @@
import { blockNodeNamed } from '../adf/block-nodes.ts'
import { blockNodeModel } from '../adf/block-nodes.ts'
import { listBreakName } from './list-break.ts'
export function blockDirectiveForm(name: string): 'container' | 'leaf' | undefined {
if (name === listBreakName) return 'leaf'
const blockNode = blockNodeNamed(name)
if (blockNode === undefined) return undefined
return blockNode.contentModel === 'none' ? 'leaf' : 'container'
const model = blockNodeModel(name)
if (model === undefined) return undefined
return model.contentModel === 'none' ? 'leaf' : 'container'
}