mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-19 06:35:44 +01:00
Answer architecture round 2: the claims type keeps directives apart from alerts and highlights, two paragraphs reflowed
This commit is contained in:
@@ -18,8 +18,10 @@ export type 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>> = {
|
||||
// Directives exclude alerts and highlights: an expand directive leaves `inExpand` unset and a directive's slot reads `==`.
|
||||
type ReadClaims = Claims & ({ directives: false } | { alerts: false; directives: true; highlights: false })
|
||||
|
||||
export const flavourClaims: Readonly<{ commonmark: ReadClaims } & Record<WrittenFlavour, ReadClaims & 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 },
|
||||
|
||||
Reference in New Issue
Block a user