Emitter 2c: the inline node directives, the directive marks and the carried whitespace #13

Merged
lilleman merged 4 commits from inline-nodes into main 2026-08-26 09:49:03 +02:00
Showing only changes of commit cd4ea04a9c - Show all commits
+8 -8
View File
@@ -64,7 +64,8 @@ survives inline parsing. Each section below says whether content is required. `:
directive only when the name is followed immediately by `[` or `{`, and `{attrs}` must follow directive only when the name is followed immediately by `[` or `{`, and `{attrs}` must follow
`]` (or the name) with no gap — anything else (`10:30`, `:smile:`, a stray `{…}` in text) is `]` (or the name) with no gap — anything else (`10:30`, `:smile:`, a stray `{…}` in text) is
literal text. An inline directive binds as a unit before bracket matching, the way a code span literal text. An inline directive binds as a unit before bracket matching, the way a code span
does: a `]` or `(` inside its `{attrs}` is the directive's, never the enclosing content's. does: a `]` or `(` inside its `{attrs}` is the directive's, never the enclosing content's, and a
`(` after its closing `]` opens no link.
**Container block**: **Container block**:
@@ -100,9 +101,9 @@ form, and omits empty `{attrs}` except where the `{` itself claims the directive
(`:hardBreak{}`). (`:hardBreak{}`).
**Escaping**: the emitter backslash-escapes whatever literal text would otherwise parse as **Escaping**: the emitter backslash-escapes whatever literal text would otherwise parse as
directive syntax — the leading `:` of a would-be directive, `]` inside content, a `{` right after directive syntax — the leading `:` of a would-be directive, `]` inside content, a `{` right
a directive's closing `]`, which would otherwise be read as the attributes it has none of; outside code after a directive's closing `]`, which would otherwise be read as the attributes it has none
spans and code blocks, a backslash before `:` in input yields a literal colon. of; outside code spans and code blocks, a backslash before `:` in input yields a literal colon.
**Malformed directives are error results**, named: an unclosed container at end of input, a body **Malformed directives are error results**, named: an unclosed container at end of input, a body
fence line of the container's length or longer, a bare colon-run line outside any container or fence line of the container's length or longer, a bare colon-run line outside any container or
@@ -216,11 +217,10 @@ One header row plus plain inline cells is a pipe table; anything richer is the d
(AGENTS.md §4). Precisely: a table emits as a pipe table exactly when the `table`, every row (AGENTS.md §4). Precisely: a table emits as a pipe table exactly when the `table`, every row
and every cell carry no attrs and no marks, the first row is all `tableHeader` and the rest all and every cell carry no attrs and no marks, the first row is all `tableHeader` and the rest all
`tableCell`, every row has the header's cell count, and every cell holds exactly one attr-less, `tableCell`, every row has the header's cell count, and every cell holds exactly one attr-less,
mark-less paragraph — an empty cell holds one empty paragraph — with no `|` anywhere the inline mark-less paragraph — an empty cell holds one empty paragraph — with no `|` anywhere the
layer spells as syntax — a code span, a link destination or title, an inline directive's inline layer spells as syntax — a code span, a link destination or title, an inline directive's
attributes: backslash escapes are inert there, so pipe form cannot spell that pipe and the table attributes: backslash escapes are inert there, so pipe form cannot spell that pipe and the table
takes the directive form. A pipe table takes the directive form. A pipe table parses back to exactly that shape.
parses back to exactly that shape.
``` ```
| Part | Qty | | Part | Qty |