mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-12 11:48:29 +01:00
10 lines
378 B
TypeScript
10 lines
378 B
TypeScript
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 model = blockNodeModel(name)
|
|
if (model === undefined) return undefined
|
|
return model.contentModel === 'none' ? 'leaf' : 'container'
|
|
}
|