mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-21 15:42:58 +01:00
Answer stability round 1: 0 🔴, 1 🟡 (0 misread); write a hostile fence whose info string holds a backtick with tildes
This commit is contained in:
@@ -197,7 +197,8 @@ const hostileBlockCarry = fc
|
|||||||
.map(([[type, untyped], named, body, spelling, other]) => {
|
.map(([[type, untyped], named, body, spelling, other]) => {
|
||||||
const value = body === 'untyped' ? untyped : body === 'typed' ? { ...untyped, type } : other
|
const value = body === 'untyped' ? untyped : body === 'typed' ? { ...untyped, type } : other
|
||||||
const json = spelling === 'canonical' ? serializeCanonicalJson(value, 'two-space') : spelling === 'compact' ? JSON.stringify(value) : JSON.stringify(value, null, 1)
|
const json = spelling === 'canonical' ? serializeCanonicalJson(value, 'two-space') : spelling === 'compact' ? JSON.stringify(value) : JSON.stringify(value, null, 1)
|
||||||
return fencedCodeBlock(`${carryFencePrefix}${named ?? type}`, json)
|
const info = `${carryFencePrefix}${named ?? type}`
|
||||||
|
return info.includes('`') ? `~~~${info}\n${json}\n~~~` : fencedCodeBlock(info, json)
|
||||||
})
|
})
|
||||||
|
|
||||||
function prefixLines(body: string, first: string, rest: (index: number) => string): string {
|
function prefixLines(body: string, first: string, rest: (index: number) => string): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user