mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-19 06:35:44 +01:00
Answer architecture round 5: the builders keep main's spelling, each writer's result and the CommonMark ask's spelling are held to the bound once built, and the engines' own overflows refuse alike
This commit is contained in:
@@ -112,18 +112,9 @@ export function slotFault(type: string, text: string): ConvertFault | undefined
|
||||
}
|
||||
|
||||
export function spellAttributes(pairs: readonly (readonly [string, string])[]): string {
|
||||
return [...attributePieces(pairs)].join('')
|
||||
}
|
||||
|
||||
export function* attributePieces(pairs: readonly (readonly [string, string])[]): Generator<string> {
|
||||
if (pairs.length === 0) return
|
||||
yield '{'
|
||||
for (const [index, [key, value]] of [...pairs].sort(([left], [right]) => keyOrder(left, right)).entries()) {
|
||||
if (index > 0) yield ' '
|
||||
yield `${key}=`
|
||||
yield value
|
||||
}
|
||||
yield '}'
|
||||
if (pairs.length === 0) return ''
|
||||
const spelled = [...pairs].sort(([left], [right]) => keyOrder(left, right)).map(([key, value]) => `${key}=${value}`)
|
||||
return `{${spelled.join(' ')}}`
|
||||
}
|
||||
|
||||
export function spellDirectiveCloser(name: string): string {
|
||||
|
||||
Reference in New Issue
Block a user