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

Answer architecture round 1: the claims type pins what every writer spells, the HTML calls take flavour names, model-written GFM reads in portableMarkdownToAdf

This commit is contained in:
2026-10-09 02:42:55 +02:00
committed by Lillem4n
parent 9805275bf7
commit 4d5f83459f
8 changed files with 52 additions and 19 deletions
+5 -1
View File
@@ -15,7 +15,11 @@ export type Claims = {
taskMarkers: boolean
}
export const flavourClaims: Readonly<Record<Flavour, Claims>> = {
// The writer spells pipe tables and `~~` in every flavour it writes.
type WrittenClaims = Claims & { pipeTables: true; strikethrough: true }
// No flavour claims directives beside alerts or highlights: an expand directive leaves `inExpand` unset and a directive's slot reads `==`.
export const flavourClaims: Readonly<{ commonmark: Claims } & Record<WrittenFlavour, WrittenClaims>> = {
commonmark: { alerts: false, carryFence: false, directives: false, highlights: false, pipeTables: false, strikethrough: false, taskMarkers: false },
lossless: { alerts: false, carryFence: true, directives: true, highlights: false, pipeTables: true, strikethrough: true, taskMarkers: false },
portable: { alerts: true, carryFence: false, directives: false, highlights: true, pipeTables: true, strikethrough: true, taskMarkers: true },