3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-14 04:30:24 +01:00
Files
adf-codec/src/markdown/block-directive-forms.ts
T

10 lines
395 B
TypeScript

import { blockDirective } from '../adf/block-directives.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'
}