Give the CommonMark blocks a directive form for what their spelling cannot hold
CI / gate (push) Successful in 5s

This commit is contained in:
2026-08-27 14:12:55 +02:00
parent 82cf28f176
commit 59b42ef0dc
30 changed files with 639 additions and 210 deletions
+6 -2
View File
@@ -11,10 +11,14 @@ export function isBareToken(text: string): boolean {
return bareToken.test(text)
}
export function vocabularyPairs(attrs: AdfAttributes, vocabulary: AttributeVocabulary, slot: string | undefined): [string, string][] | undefined {
export function vocabularyPairs(
attrs: AdfAttributes,
vocabulary: AttributeVocabulary,
spelledElsewhere: readonly (string | undefined)[],
): [string, string][] | undefined {
const pairs: [string, string][] = []
for (const [key, value] of Object.entries(attrs)) {
if (key === slot) continue
if (spelledElsewhere.includes(key)) continue
const kind = Object.hasOwn(vocabulary, key) ? vocabulary[key] : undefined
if (kind === undefined) return undefined
const spelled = spellAttributeValue(value, kind)