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

21 - the ADF tables carry ADF's nouns

This commit is contained in:
2026-09-21 21:39:59 +02:00
parent 4f4302b5ba
commit 4036b677ed
16 changed files with 111 additions and 102 deletions
+4 -4
View File
@@ -1,9 +1,9 @@
import { blockDirective } from '../adf/block-directives.ts'
import { blockNodeNamed } 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 directive = blockDirective(name)
if (directive === undefined) return undefined
return directive.contentModel === 'none' ? 'leaf' : 'container'
const blockNode = blockNodeNamed(name)
if (blockNode === undefined) return undefined
return blockNode.contentModel === 'none' ? 'leaf' : 'container'
}