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

Build a hardBreak carrying no marks where a mark spelling spans a line break, in every reader

This commit is contained in:
2026-10-09 10:54:56 +02:00
parent 78655bcdc0
commit 39fda3341e
9 changed files with 50 additions and 44 deletions
+18 -17
View File
@@ -533,24 +533,25 @@ destination is empty too, `[]()`, as nothing.
- `textColor` — Attributes: `color` (string, `#rrggbb`).
- `underline` — Attributes: none.
A spelling adds its mark to every inline node it wraps, and nesting is the marks array in order,
outermost first: `_!adf:underline[x]_` 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: `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.
A spelling adds its mark to every inline node it wraps but a hard break, which Atlassian's schema
gives no marks, and nesting is the marks array in order, outermost first: `_!adf:underline[x]_`
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: `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.
An inline node whose marks no nesting spells — 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 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).
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
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).
```
!adf:textColor[**Overdue**]{color="#ae2e24"}, H!adf:subsup[2]{type=sub}O, !adf:underline[signed].