3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-12 11:48:29 +01:00

Answer architecture round 2: 0 🔴, 1 🟡; the ClaimedPrefix comment sits on its type again, README names the marks fallback

This commit is contained in:
2026-10-14 10:10:09 +02:00
committed by Lillem4n
parent c8ea357fa7
commit 8188bc5e16
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -317,8 +317,9 @@ Ping !adf:mention[@Mikael]{id=5b10a2} — !adf:status[In review]{color=yellow}
- Attributes are `{key=value key2="two words"}`: keys alphabetical, a value bare where it is
`[A-Za-z0-9_-]+`, else double-quoted with JSON string escaping. A number or JSON value is spelled as
canonical JSON, but `colwidth` is its widths joined by commas, `colwidth="340,420"`, and a block's
`marks` names each mark with its attributes, `marks="breakout{mode=wide}"`. An empty `attrs`, `content` or `marks` key is spelled `{attrs=empty}`,
`{content=empty}` or `{marks=empty}`.
`marks` names each mark with its attributes, `marks="breakout{mode=wide}"`, keeping the JSON array
where a mark's type or attributes are ones the flavour does not list. An empty `attrs`, `content`
or `marks` key is spelled `{attrs=empty}`, `{content=empty}` or `{marks=empty}`.
- Three reserved names build no node: `!adf:carry` is the inline opaque carry, `!adf:doc {content=none}`
spells a document holding no `content` key, and `!adf:textBreak{}` parts two adjacent text nodes
CommonMark would read back as one.
+1 -1
View File
@@ -11,9 +11,9 @@ import { serializeCanonicalJson } from '../canonical-json.ts'
export type AttributeReading = { refusal: 'kind' | 'nesting'; value?: undefined } | { refusal?: undefined; value: VocabularyValue }
// Proof that `!adf:` stands at `index`; only `claimDirectivePrefix` builds one.
export type Attributes = { attributes: DirectiveAttributes; end: number }
// Proof that `!adf:` stands at `index`; only `claimDirectivePrefix` builds one.
export type ClaimedPrefix = { readonly [claimedPrefix]: true; readonly index: number }
export type DirectiveValue = { decoded: string; spelling: string }