Give the CommonMark blocks a directive form for what their spelling cannot hold
CI / gate (push) Successful in 5s
CI / gate (push) Successful in 5s
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user