3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-19 14:45:44 +01:00

Answer architecture round 3: the forecast never overcounts, the carry's JSON and the portable code block join through joinedWithin, and the list's choice of form stands in its own function

This commit is contained in:
2026-10-12 17:52:15 +02:00
committed by Lillem4n
parent 3414c8690a
commit ae1a47f1bc
14 changed files with 83 additions and 84 deletions
-4
View File
@@ -15,10 +15,6 @@ export function closingBacktickRun(text: string, from: number, opener: number):
return undefined
}
export function fencedCodeBlock(info: string, body: string): string {
return fencePieces(info, body).join('')
}
export function fencePieces(info: string, body: string): string[] {
const fence = '`'.repeat(Math.max(3, longestBacktickRun(body) + 1))
return body === '' ? [fence, info, '\n', fence] : [fence, info, '\n', body, '\n', fence]