From 8188bc5e16267312ebdbdff178c552381906454a Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 14 Oct 2026 10:10:09 +0200 Subject: [PATCH] =?UTF-8?q?Answer=20architecture=20round=202:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=201=20=F0=9F=9F=A1;=20the=20ClaimedPrefix=20comme?= =?UTF-8?q?nt=20sits=20on=20its=20type=20again,=20README=20names=20the=20m?= =?UTF-8?q?arks=20fallback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +++-- src/markdown/directive-syntax.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 53319f5..55ca48c 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/src/markdown/directive-syntax.ts b/src/markdown/directive-syntax.ts index 261810a..87c4db8 100644 --- a/src/markdown/directive-syntax.ts +++ b/src/markdown/directive-syntax.ts @@ -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 }