mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-18 22:25: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:
@@ -15,9 +15,9 @@ export function closingBacktickRun(text: string, from: number, opener: number):
|
||||
return undefined
|
||||
}
|
||||
|
||||
export function fencePieces(info: string, body: string): string[] {
|
||||
export function fencedCodeBlock(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]
|
||||
return body === '' ? `${fence}${info}\n${fence}` : `${fence}${info}\n${body}\n${fence}`
|
||||
}
|
||||
|
||||
export function longestBacktickRun(text: string): number {
|
||||
|
||||
Reference in New Issue
Block a user