diff --git a/docs/decisions.md b/docs/decisions.md index 0725c68..0429182 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -23,8 +23,8 @@ sanitized and a mention keeps the test user's real account id. ## Markdown in is a canonical fixpoint -2026-08-23, the maintainer; every parsed document converts back since 2026-10-04. Goals 1 and 4. Valid while -markdown input may be written by hand. +2026-08-23, the maintainer; every parsed document has converted back since 2026-10-04. Goals 1 and +4. Valid while markdown input may be written by hand. The other direction is a canonical fixpoint, not byte-identity: human markdown normalizes, the way back yields the library's canonical spelling, and that spelling round-trips byte-identically. @@ -494,9 +494,8 @@ exits 0 on. while `todo.md` items 59, 60, 61 and 62 are open. A four-seat comprehension panel scored the project under the floor of 7. Its scoring run of -2026-10-04 is the baseline. Since 2026-10-04, a chunk whose panel scores any dimension -lower improves what the seats named and scores again, and after three such rounds asks the -maintainer. +2026-10-04 is the baseline. Since 2026-10-04, a chunk whose panel scores any dimension lower +improves what the seats named and scores again, and after three such rounds asks the maintainer. | Seat | Navigation | Locality | Shape | Self-sufficiency | Overall | |---|---|---|---|---|---| diff --git a/spec/flavour.md b/spec/flavour.md index 3f692c4..7bb2458 100644 --- a/spec/flavour.md +++ b/spec/flavour.md @@ -474,15 +474,15 @@ The rest take no content, `!adf:text` included; content on a node that takes non Shipped !adf:emoji[🎉]{shortName=":tada:"} on !adf:date{timestamp=1756080000000}. ``` -**Text CommonMark cannot hold plainly.** A carriage return in text is ` `, which CommonMark reads -back as the character. Three things are spelled `!adf:text{text="…"}`: a newline inside a text +**Text CommonMark cannot hold plainly.** A carriage return in text is ` `, which CommonMark +reads back as the character. Three things are spelled `!adf:text{text="…"}`: a newline inside a text node; a null character, which CommonMark reads as U+FFFD; and a space or tab where CommonMark strips or refuses one — a block's inline content edges, either side of a line break, an em, strong or strike spelling's inner edges, a pipe cell's edges. The reserved key carries the node's text, -escaped by the attribute grammar and never literal: pipe cells trim and pad. The emitter wraps the run alone and -leaves the rest plain text, which the spelled run joins on reading. Input reads that spelling -alone: the value is one run of spaces and tabs, one run of newlines, or one run of null characters, -and anything else — a mixed run, or text CommonMark carries plainly — is a named error. +escaped by the attribute grammar and never literal: pipe cells trim and pad. The emitter wraps the +run alone and leaves the rest plain text, which the spelled run joins on reading. Input reads that +spelling alone: the value is one run of spaces and tabs, one run of newlines, or one run of null +characters, and anything else — a mixed run, or text CommonMark carries plainly — is a named error. ``` !adf:text{text=" "}Two leading spaces held, and one text node split!adf:text{text="\n"}over two lines. @@ -536,11 +536,12 @@ An inline node whose marks no nesting spells — a mark type not listed here, an spelling does not list, a value that is not the spelling's type, an attribute the spelling needs and the mark lacks, an empty `attrs` on a mark CommonMark spells, an order putting a code span outside another mark, `code` over anything but a text node holding text, or over text holding a line ending -or a null character, or a spelling CommonMark's flanking rules cannot open or close where the run sits (`un**-real**istic`), or one -CommonMark's matching pairs elsewhere — the intra-word `*` runs together with a neighbouring `**`, -and the multiple-of-3 rule can leave the merged run's pairing to another delimiter — rides the -inline carry whole. An opaque carry inside a mark spelling is a named error in input: the carry -restores its node exactly, marks included (`docs/decisions.md` §Unknown nodes ride the carry). +or a null character, or a spelling CommonMark's flanking rules cannot open or close where the run +sits (`un**-real**istic`), or one CommonMark's matching pairs elsewhere — the intra-word `*` runs +together with a neighbouring `**`, and the multiple-of-3 rule can leave the merged run's pairing to +another delimiter — rides the inline carry whole. An opaque carry inside a mark spelling is a named +error in input: the carry restores its node exactly, marks included (`docs/decisions.md` §Unknown +nodes ride the carry). ``` !adf:textColor[**Overdue**]{color="#ae2e24"}, H!adf:subsup[2]{type=sub}O, !adf:underline[signed]. diff --git a/src/markdown/directive-syntax.ts b/src/markdown/directive-syntax.ts index 623c71e..30d205b 100644 --- a/src/markdown/directive-syntax.ts +++ b/src/markdown/directive-syntax.ts @@ -100,7 +100,7 @@ export function readSoleStringAttribute(span: DirectiveSpan, key: string): Read< return { value: spelled.decoded } } -// No content slot holds a line ending or a null character, which only the text directive spells; the emitter carries such a node. +// An inline directive never spans lines, and no content slot holds a null character; the emitter carries such a node. export function slotFault(type: string, text: string): ConvertFault | undefined { if (/[\n\r]/.test(text)) return { code: 'unspellable-whitespace', message: `the ${type} content slot holds a newline no inline directive spans` } return holdsNullCharacter(text) ? unsupportedNodeShape(`the ${type} content slot holds a null character: write the node as !adf:carry`) : undefined