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

Answer prose round 1: plainer decision title and spec, the refusal the spec owes, and comments that say why

This commit is contained in:
2026-10-09 11:50:23 +02:00
committed by Lillem4n
parent d1a47e861c
commit e4364b19d0
12 changed files with 40 additions and 41 deletions
+18 -18
View File
@@ -511,20 +511,20 @@ Hello, !adf:textBreak{}world — **Hello, !adf:textBreak{}world** — `a`!adf:te
An inline node's marks ride the spelling wrapped around them, never the block sections' reserved
`marks` key. `code`, `em`, `strike` and `strong` keep their markdown spellings, and are not
directive names: `!adf:em[x]` is a named error. `border`, `subsup`, `textColor` and `underline`
are inline directives, content required non-empty. `link` keeps its markdown spelling wherever
CommonMark holds it — `<url>` for a bare autolink-shaped text, else `[text](url "title")` — and is
the inline directive `!adf:link[text]{attrs}` only where CommonMark does not: an attribute besides
`href` and `title`, an `href` or `title` no canonical escape spells (a control character, a
backslash, an entity reference, an angle bracket beside a space or opening a bare destination, a
newline in the title), or a link opening a paragraph whose markdown spelling would read as a link
reference definition. Every such spelling carries an `href`: a directive link CommonMark could spell
is a named error, and so is one spelling none. No link wraps a link at any nesting, which is
CommonMark's own rule: a `[text]` already holding one leaves the outer brackets literal text, and
the directive form, open to no literal reading, is a named error. ADF holds no empty text node, so a
link whose text is empty reads as its destination linked, `[](/url)` as `/url`, and one whose
destination is empty too, `[]()`, as nothing. A link text holding only hard breaks reads the same,
followed by its hard breaks.
directive names: `!adf:em[x]` is a named error. `border`, `subsup`, `textColor` and `underline` are
inline directives, content required, holding more than hard breaks. `link` keeps its markdown
spelling wherever CommonMark holds it — `<url>` for a bare autolink-shaped text, else `[text](url
"title")` — and is the inline directive `!adf:link[text]{attrs}` only where CommonMark does not: an
attribute besides `href` and `title`, an `href` or `title` no canonical escape spells (a control
character, a backslash, an entity reference, an angle bracket beside a space or opening a bare
destination, a newline in the title), or a link opening a paragraph whose markdown spelling would
read as a link reference definition. Every such spelling carries an `href`: a directive link
CommonMark could spell is a named error, and so is one spelling none. No link wraps a link at any
nesting, which is CommonMark's own rule: a `[text]` already holding one leaves the outer brackets
literal text, and the directive form, open to no literal reading, is a named error. ADF holds no
empty text node, so a link whose text is empty reads as its destination linked, `[](/url)` as
`/url`, and one whose destination is empty too, `[]()`, as nothing. A link text holding only hard
breaks reads the same, followed by its hard breaks.
- `border` — Attributes: `color` (string, `#rrggbb` or `#rrggbbaa`), `size` (number, 1–3).
- `code`, `em`, `strike`, `strong` — Attributes: none.
@@ -539,10 +539,10 @@ gives no marks, and nesting is the marks array in order, outermost first: `_!adf
gives marks `[em, underline]`, `!adf:underline[_x_]` the reverse. `adfToLosslessMarkdown` nests in
the order the array holds rather than sorting it — `docs/decisions.md` §Equality is deep restores
the array, not a set — and opens each spelling once over the longest run of adjacent inline nodes
carrying an identical mark, attributes included, at that depth, an emphasis or link spelling also
spanning the hard breaks between two of them: `attrs: {}` differs from no `attrs`, and a directive
spells it `{attrs=empty}`. A run breaks at every node the emitter carries, so no emitted carry sits
inside a mark spelling.
carrying an identical mark, attributes included, at that depth: `attrs: {}` differs from no `attrs`,
and a directive spells it `{attrs=empty}`. An emphasis or link spelling also spans the hard breaks
between two nodes of its run. A run breaks at every node the emitter carries, so no emitted carry
sits inside a mark spelling.
An inline node whose marks no nesting spells — a hard break holding any mark, a mark type not listed
here, an attrs key its spelling does not list, a value that is not the spelling's type, an attribute