Corpus 1d2: the block-node pairs #7

Merged
lilleman merged 5 commits from corpus-block-nodes into main 2026-08-24 14:07:00 +02:00
6 changed files with 49 additions and 17 deletions
Showing only changes of commit 86248240dd - Show all commits
@@ -66,10 +66,18 @@
"content": [
{
"attrs": {
"collection": "contentId-98237",
"id": "01a03389-e4eb-76a1-9eae-e8b7a01f4787",
"type": "file"
"alt": "The assembly drawing",
"type": "external",
"url": "https://example.com/assembly.png"
},
"marks": [
{
"attrs": {
"href": "https://example.com/assembly"
},
"type": "link"
}
],
"type": "media"
}
],
@@ -14,5 +14,5 @@ Taken from Kiruna.
:::
:::mediaSingle {layout=center}
::media {collection=contentId-98237 id=01a03389-e4eb-76a1-9eae-e8b7a01f4787 type=file}
::media {alt="The assembly drawing" marks="[{\"attrs\":{\"href\":\"https://example.com/assembly\"},\"type\":\"link\"}]" type=external url="https://example.com/assembly.png"}
:::
@@ -78,6 +78,25 @@
}
],
"type": "tableRow"
},
{
"content": [
{
"content": [
{
"content": [
{
"text": "60",
"type": "text"
}
],
"type": "paragraph"
}
],
"type": "tableCell"
}
],
"type": "tableRow"
}
],
"type": "table"
@@ -12,4 +12,9 @@ Bolt M8
40
:::
::::
::::tableRow
:::tableCell
60
:::
::::
:::::
+9 -9
View File
@@ -18,8 +18,8 @@ normalizes to it through the round-trip.
inline, so a `~~~` line opens a CommonMark tilde code fence.
- Bullet lists `- `; ordered lists incrementing `1.` `2.` `3.`, the first number taken from the
node's `order` attribute. Continuation lines align with the first character after the marker
(two spaces for `- `, three for `1. `); blank lines inside an item are empty lines. Lists are
tight — blank lines between items normalize away; ADF does not record tightness.
(two spaces for `- `, three for `1. `); blank lines inside an item are empty lines, none before
a nested list. Blank lines between items normalize away; ADF does not record tightness.
- Blockquotes prefix lines with `> `; a blank line inside a blockquote is a bare `>`.
- ATX headings (`#``######`); setext input normalizes to ATX.
- Code fences ``` with the node's language as info string, the fence lengthened past any backtick
@@ -42,9 +42,9 @@ normalizes to it through the round-trip.
the leading delimiter of a construct that would otherwise open, re-scan from there, and repeat —
with the opener literal the closer parses as text, so `*not emphasis*` is `\*not emphasis*`, one
backslash.
- Blocks separated by one blank line at document level, and between CommonMark blocks; two
directive blocks inside a container take none. No trailing whitespace outside a code block's
content, single trailing newline; a document with no blocks is the empty string.
- Blocks separated by one blank line at document level and between CommonMark blocks outside a
list; two directive blocks inside a container take none. No trailing whitespace outside a code
block's content, single trailing newline; a document with no blocks is the empty string.
## Directives
@@ -199,10 +199,10 @@ The moon, at night.
**The CommonMark image.** A paragraph whose entire inline content is one image `![alt](url)` is
a `mediaSingle` with attrs exactly `{"layout":"center"}` holding an `external` `media``url`
from the destination, `alt` the description's plain-text content when non-empty. `adfToMarkdown`
emits the image form for exactly that shape — those attrs and no others, no marks, no caption,
and a `media` carrying nothing beyond `alt`, `type` and `url`. An image amid other text, or one
carrying a title, is a named error: `mediaInline` carries a media `collection` + `id`, never a
URL, and no media node carries a title.
emits the image form for exactly that shape — those attrs and no others, no marks on either
node, no caption, and a `media` carrying nothing beyond `alt`, `type` and `url`. An image amid
other text, or one carrying a title, is a named error: `mediaInline` carries a media
`collection` + `id`, never a URL, and no media node carries a title.
### Tables
+4 -4
View File
@@ -39,10 +39,10 @@ detail is settled at its own milestone.
`[t](u "He said "hi"")`, which holds no title. Two defensible spellings each — angle
brackets or a backslash escape, and for titles `'…'` or `(…)` besides — so §8 leaves the
pick here. **Also blocked**: block separation is unstated for a CommonMark block beside a
directive block in a container body — a `panel` (`panelType` `info`) whose content is
`paragraph` "A" then a `panel` (`panelType` `warning`) holding "B" spells `A` and
`:::panel warning` either on consecutive lines or with a blank line between. Two defensible
spellings, so §8 leaves the pick here.
directive block in a container body — an `expand` whose content is `paragraph` "A" then a
`panel` (`panelType` `warning`) holding "B" spells `A` and `:::panel warning` either on
consecutive lines or with a blank line between. Two defensible spellings, so §8 leaves the
pick here.
- [x] **1d1 — The CommonMark subset**: blockquote, bulletList, codeBlock, heading, orderedList,
paragraph, rule, listItem, hardBreak, text, code spans, and the `code`, `em`, `link`,
`strike` and `strong` marks — one mark per text node; nesting is 1d5's.