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:
@@ -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'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user