Files
adf-codec/src/markdown/inline-directive-spelling.ts
T
2026-08-27 22:16:27 +02:00

10 lines
578 B
TypeScript

import type { AdfNode } from '../adf/document.ts'
import type { InlineDirective } from '../adf/inline-directives.ts'
import { spellAttributes, spellVocabulary } from './directive-attributes.ts'
import { vocabularyPairs } from '../adf/attribute-vocabulary.ts'
export function spellInlineNodeAttributes(node: AdfNode, directive: InlineDirective): string | undefined {
const pairs = vocabularyPairs(node.attrs ?? {}, directive.attributes, directive.slot === undefined ? [] : [directive.slot])
return pairs === undefined ? undefined : spellAttributes(spellVocabulary(pairs))
}