diff --git a/README.md b/README.md
index b97cdf4..a29c212 100644
--- a/README.md
+++ b/README.md
@@ -426,7 +426,6 @@ document normalizes to it through the round-trip.
| `paragraph` | one line, no soft wraps |
| `rule` | `---` |
| `table` of one header row and plain inline cells | a pipe table, every row opening and closing with a pipe |
-| `taskList`, `taskItem` | `
`, `
text
` |
| `text` marked `code`, `em`, `strike`, `strong` | `` `code` ``, `_em_` (`*em*` inside a word), `~~strike~~`, `**strong**` |
| `text` holding a carriage return | `
` |
| `text` holding a newline, a null character, or a space or tab CommonMark strips (a block's inline edges, either side of a hard break, a pipe cell's edges, an em, strong or strike spelling's inner edges) | that run as `!adf:text{text="…"}`, the rest plain: `!adf:text{text=" "}Two leading spaces` |
@@ -581,9 +580,10 @@ content. No stylesheet ships. The complete dialect:
| `paragraph` | `
`; `style="text-align:center"` or `text-align:right`, as on a heading |
| `rule` | `
`, `` for a first row of `tableHeader` cells alone, ``, `
`, `
` and `
`; a cell's first paragraph stands as an item's does, and `
` writes its attributes |
+| `taskList`, `taskItem` | `
`, `
text
` |
| `text` marked `code`, `em`, `strike`, `strong`, `subsup`, `underline` | ``, ``, ``, ``, `` or ``, ``, the first mark outermost |
-| `text` marked `textColor`, `backgroundColor` | ``, `` |
-| an attribute its type holds that its element does not write, such as `localId`, on a paragraph, heading, quote, list, list item, table, row, cell, code block, rule, panel, expand, task or decision list or item, media, media single, caption, media group, emoji, mention, status, date or card | `data-*` named as HTML's `dataset` names it: `
` |
+| `text` marked `backgroundColor`, `textColor` | ``, `` |
+| an attribute its type holds that its element does not write, such as `localId`, on a paragraph, heading, quote, list, list item, table, row, cell, code block, rule, panel, expand, task or decision list or item, media, media single, caption, emoji, mention, status, date or card | `data-*` named as HTML's `dataset` names it: `
` |
| any other node, or a node holding what its element cannot, except a shape Atlassian's schema forbids, which is refused ([The errors](#the-errors)) | `
its content
`, a `` inline |
- Every URL is written as the ADF holds it, `javascript:` included: a link's, an image's, a
diff --git a/spec/html.md b/spec/html.md
index 5670cee..9cf4565 100644
--- a/spec/html.md
+++ b/spec/html.md
@@ -14,10 +14,10 @@ Blocks are separated by a line feed, and a document holding any ends with one. A
| `blockquote` | `
`, a line feed, its blocks, a line feed, `
` |
| `bulletList` | `
`, a line feed, its items a line each, a line feed, `
` |
| `codeBlock` | `
…
`, the language one token holding no ASCII whitespace (a tab, line feed, form feed, carriage return or space); no `class` where it holds no `language` |
-| `heading`, `level` 1 to 6 | `
…
` to `
…
` |
-| `listItem` | its first paragraph straight after `
`: bare where it holds content and no attribute, `
Bolt
`, and as its `
` element where it holds an attribute, `
Bolt
`; where other blocks follow, each after a line feed, and a line feed before ``. Where the first block is no paragraph, holds neither content nor an attribute, or rides the carry: `
`, a line feed, its blocks, a line feed, `
` |
| `decisionList` | `
`, a line feed, its items a line each, a line feed, `
`; each `decisionItem` is `
` around its inline content |
| `expand`, `nestedExpand` | ``, ``, a line feed, a `` holding the `title` where there is one, its blocks, each after a line feed, a line feed, `` |
+| `heading`, `level` 1 to 6 | `
…
` to `
…
` |
+| `listItem` | its first paragraph straight after `
`: bare where it holds content and no attribute, `
Bolt
`, and as its `
` element where it holds an attribute, `
Bolt
`; where other blocks follow, each after a line feed, and a line feed before `
`. Where the first block is no paragraph, holds neither content nor an attribute, or rides the carry: `
`, a line feed, its blocks, a line feed, `
` |
| `mediaGroup` | `
` holding a `` for each `media`, none between |
| `mediaSingle`, centered, holding one external `media` | `
`.
| ADF | HTML |
| --- | --- |
-| `date` | ``, the day in UTC |
| `backgroundColor`, `textColor` | ``, `` around the text; the colour a `#` and letters and digits, or letters and digits alone |
| `code`, `em`, `strike`, `strong`, `underline` | ``, ``, ``, ``, `` around the text |
+| `date` | ``, the day in UTC |
| `emoji` | `🎉`, its `text` the content |
| `hardBreak` | ` ` |
| `inlineCard`, holding a `url` | `https://example.com/spec` |
@@ -143,13 +143,12 @@ later release writes it as its own element.
- A node rides the carry where it holds a mark or a key its element does not write, an attribute
its type does not hold as that kind, an empty `attrs`, `content` or `marks`, or a value its
element cannot hold:
- - text holding no character, or a character HTML cannot hold; text holding a mark twice, or a
- mark with attributes besides a link's `href` and `title`;
+ - text holding no character, or a character HTML cannot hold; text holding a mark twice, a link
+ with attributes besides `href` and `title`, or a mark with an attribute its element does not
+ write;
- an unmarked text node straight after one written as plain text, which would read back as one;
- a link whose `href` or `title` holds a character HTML cannot hold, and an image whose `url` or
`alt` holds one or whose link's `href` or `title` does;
- - an image holding an attribute besides its `center` layout and its media's `type`, `url` and
- non-empty `alt`;
- a heading whose `level` is not 1 to 6, and an ordered list whose `order` is not a safe integer
or is `-0`;
- an emoji, mention or status with no `text`, and a date whose `timestamp` names no day from year
@@ -162,8 +161,8 @@ later release writes it as its own element.
- a `mediaSingle` holding anything but one `media`, then at most one `caption`, or a `mediaGroup`
holding anything but `media`; a `media` holding more than one mark, a mark that is no link, or a
`height` or `width` that is not a positive safe integer;
- - a paragraph or heading holding a mark besides one `center` or `end` alignment, a `textColor`
- or `backgroundColor` whose `color` is not letters and digits after an optional `#`;
+ - a paragraph or heading holding a mark besides one `center` or `end` alignment;
+ - a `textColor` or `backgroundColor` whose `color` is not letters and digits after an optional `#`;
- a `panel` or `expand` holding an attribute its type does not hold as that kind; a `taskItem`
whose `state` is not `DONE` or `TODO`, or a task or decision list holding a node that is no
item of its own kind, `blockTaskItem` included: the whole list rides the carry;
diff --git a/src/html/block-classes.ts b/src/html/block-classes.ts
index 1dd70b4..8484d80 100644
--- a/src/html/block-classes.ts
+++ b/src/html/block-classes.ts
@@ -10,7 +10,7 @@ const listTypes: readonly TaskListType[] = ['decisionList', 'taskList']
export const expandClasses: Readonly> = { expand: 'adf-expand', nestedExpand: 'adf-nested-expand' }
export const panelClass = 'adf-panel'
-// The panel type and an item's state are no attribute of the vocabularies, which a directive spells as its argument; here each is a data-* attribute like the rest.
+// A panel's type is no attribute of the vocabularies, since a directive spells it as its argument; here it is a data-* attribute like the rest.
export const panelAttributes: AttributeVocabulary = { ...blockNodes.panel.attributes, panelType: 'string' }
// A task or decision list, its items' type, class and attributes.
diff --git a/src/html/media-element.ts b/src/html/media-element.ts
index d9c655e..607a058 100644
--- a/src/html/media-element.ts
+++ b/src/html/media-element.ts
@@ -26,7 +26,7 @@ export function mediaImage(media: AdfNode): string | undefined {
return `${anchor}${link === undefined ? '' : ''}`
}
-// The attributes an `` of the dialect holds, read as `readMediaImage` reads them; `fault` names no `src`, or a `class` besides one.
+// The media attributes an `` of the dialect holds; `fault` where its `src`, `class`, `alt`, size or `data-*` attributes are not the ones `imageAttributes` writes.
export function readMediaImage(pairs: readonly (readonly [string, string])[]): Read {
let rest = pairs
const attrs: AdfAttributes = {}
diff --git a/src/html/parse/html-to-adf.test.ts b/src/html/parse/html-to-adf.test.ts
index 57719bd..c66517b 100644
--- a/src/html/parse/html-to-adf.test.ts
+++ b/src/html/parse/html-to-adf.test.ts
@@ -640,6 +640,18 @@ test('reads panels, expands and nested expands nested 500 levels, and refuses th
}
})
+test('reads a task or decision list nested 499 levels, its items one level below it, and refuses the next level', () => {
+ const lists = [
+ '
'.repeat(levels)}\n`
+ for (const list of lists) {
+ assert.equal(refusal(htmlToAdf(panels(499, list))), 'read')
+ assert.equal(refusal(htmlToAdf(panels(500, list))).startsWith('unsupported-nesting-depth'), true)
+ }
+})
+
test('reads a media of no url as an of class adf-media', () => {
const single = htmlToAdf('\n')
assert.deepEqual(read(single), document({ content: [{ attrs: { type: 'external' }, type: 'media' }], type: 'mediaSingle' }))
@@ -662,6 +674,7 @@ const pinnedRefusals: readonly (readonly [string, string])[] = [
['
\n
a
\n
\n', 'unmappable-html at /content/0/content/0: an
of this list has class="adf-task" first'],
['
\n
a
\n
\n', 'unmappable-html at /content/0/content/0: a task item\'s text stands a space after its checkbox: found "a
\\n\\n"'],
['
\n
\n
\n', 'unmappable-html at /content/0/content/0: a task item holds text where a space follows its checkbox: found "\\n\\n"'],
+ ['
\n
a
\n
\n', 'unmappable-html at /content/0/content/0:
as written here is no inline element of the dialect: found "
a
\\n\\n"'],
['
\n
a
\n
\n', 'unmappable-html at /content/0/content/0: a task item starts with , checked where its data-state is DONE: found "a\\n\\n"'],
['
\n
a
\n
\n', 'unmappable-html at /content/0/content/0: a task item starts with , checked where its data-state is DONE: found " "…'],
['
\n
a
\n
\n', 'unmappable-html at /content/0/content/0: a task item starts with , checked where its data-state is DONE: found "', end)) {
- const stop = nodes.length === 0 ? { at: end, message: `a task item holds text where a space follows its checkbox: ${foundAt(html, end)}` } : misread(html, end, 'an item holds inline content, then , as one line', 'no inline element of the dialect')
+ const stop = nodes.length === 0 && done !== undefined ? { at: end, message: `a task item holds text where a space follows its checkbox: ${foundAt(html, end)}` } : misread(html, end, 'an item holds inline content, then , as one line', 'no inline element of the dialect')
return refused('unmappable-html', stop.message, html, stop.at, place)
}
return success({ end: end + ''.length, node: { ...node, content: nodes } })
diff --git a/todo.md b/todo.md
index 2ce52e9..438eebf 100644
--- a/todo.md
+++ b/todo.md
@@ -6,7 +6,7 @@
`Bar = 0.1`
-`Next ID = 187`
+`Next ID = 188`
## Items
@@ -15,7 +15,7 @@
| 184 | 0.4.0 | | question | **Write indentation as HTML in `adfToHtml` and read it back in `htmlToAdf`, in place of the carry element, once the maintainer settles whether its element carries a `margin-left` style.** | 1 | 2 | 2 | 3 | 2 | 6 by 2 | 3.2 |
| 185 | 0.4.0 | | question | **Read `` as the same expand, or keep refusing it, once the maintainer settles which.** | 1 | 1 | 2 | 2 | 2 | 6 by 1 | 1.6 |
| 46 | 0.4.0 | | | **Publish the bundle size in the README, failing the release pipeline when it drifts.** | 2 | 2 | 1 | 3 | 4 | 3 by 3 | 2.6 |
-| 186 | 0.4.0 | | | **Name the colour spelling `style="color:#rrggbb"` in the refusal of a `` or `` whose style differs from it.** | 1 | 1 | 1 | 1 | 1 | 6 by 1 | 1.9 |
+| 186 | 0.4.0 | | | **Name every spelling of the dialect's `
`, `` and `` in the refusal of one that matches none.** | 1 | 1 | 1 | 1 | 1 | 6 by 1 | 1.9 |
| 174 | 0.4.0 | | defect | **Bound the passes `trimmedEdges` takes by a constant, so a line of alternating code and emphasized blanks trims in linear time.** | 3 | 1 | 2 | 4 | 7 | 9 by 3 | 1.9 |
| 51 | 0.4.0 | | | **Match a reference label to its definition under Unicode case folding.** | 2 | 1 | 2 | 3 | 4 | 4 by 2 | 1.7 |
| 148 | 0.4.0 | | | **Ship conversion between ADF and Jira wiki markup both ways, under a README goal for wiki markup.** | 3 | 2 | 2 | 5 | 7 | 3 by 5 | 0.8 |
@@ -34,6 +34,7 @@
| 82 | 0.5.0 | | | **Give the directive tests and fixtures random UUID v7 ids in place of `a-1`, `a`, `x` and `h`.** | 2 | 1 | 1 | 2 | 3 | code health by 1 | 5.3 |
| 178 | 0.5.0 | | owner | **Reach the comprehension floor: move the reasoning behind the emitter's fallback and escape loops into the code that runs them, so each reads on its own.** | 3 | 1 | 2 | 4 | 7 | code health by 8 | 5.0 |
| 58 | 0.5.0 | | | **Port `ci.sh`, `publish.sh`, `docker-runner.sh` and `mutation-tests/run.sh` to standalone Python scripts.** | 4 | 2 | 2 | 6 | 6 | code health by 3 | 3.5 |
+| 187 | 0.5.0 | | | **Write a `blockTaskItem` and a nested task list as HTML in `adfToHtml` and read them back in `htmlToAdf`, in place of the carry element.** | 2 | 2 | 2 | 4 | 3 | 6 by 2 | 2.4 |
| 9 | 0.5.0 | | | **Ship an online sandbox: a web page with two textboxes converting between ADF and markdown on the library's browser build.** | 3 | 2 | 1 | 4 | 6 | 3 by 6 | 1.7 |
| 34 | 0.5.0 | | | **Read emphasis flanking by the whole character beside an astral symbol.** | 2 | 1 | 2 | 3 | 3 | 4 by 1 | 1.2 |
| 74 | 0.5.0 | | owner | **Keep the release path publishing after npm retires bypass-2FA tokens.** | 3 | 2 | 4 | 7 | 4 | | 0.0 |
@@ -50,9 +51,9 @@
### 184. Write indentation as HTML in `adfToHtml` and read it back in `htmlToAdf`, in place of the carry element, once the maintainer settles whether its element carries a `margin-left` style.
-Item 136 wrote alignment, underline, colours, subscript and superscript as HTML and left indentation on the carry element, since the writer panel did not settle one spelling.
+Alignment, underline, colours, subscript and superscript are written as HTML, and indentation stays on the carry element, since the writer panel did not settle one spelling.
-A writer panel of seven picked `data-indent-level` for the attribute name, 5 of 7. It split on whether a `margin-left` style stands beside it: 4 readers wanted the style as well, so a browser shows the indent, and 3 wanted the data attribute alone, as the alignment style is the only presentation the dialect writes.
+A writer panel of seven picked `data-indent-level` for the attribute name, 5 of 7. It split on whether a `margin-left` style stands beside it: 4 readers wanted the style as well, so a browser shows the indent, and 3 wanted the data attribute alone, as the alignment and colour styles are the only presentation the dialect writes.
Recommendation: the data attribute alone. The dialect writes no style the viewer needs to read the document, and a `margin-left` in some unit would be a second spelling of the level that has to agree with it. The level stays one value, `data-indent-level="2"`, and a block holding an indentation mark takes no other mark.
@@ -76,9 +77,9 @@ or report the unminified gzip). The figure lands in README §The package beside
dependencies" claim, and in a size column of the comparison table. Measured today,
unminified: tarball 60.4 kB, unpacked 221.5 kB, JS gzipped 45.6 kB.
-### 186. Name the colour spelling `style="color:#rrggbb"` in the refusal of a `` or `` whose style differs from it.
+### 186. Name every spelling of the dialect's `
`, `` and `` in the refusal of one that matches none.
-A reader who writes ``, `` or a bare `` gets the carry element's refusal or "no inline element of the dialect", neither of which names the spelling `adfToHtml` writes: `style="color:#rrggbb"`, no space, six lowercase hex digits, and ``. Add the spelling to the message of `readCarry` for a `span` and to the one `readTagged` gives a `mark`, each pinned in `pinnedRefusals`.
+A `
` or `` of the dialect that is no carry element is refused with a message naming the carry element and the classes of `nodeElements`, which leaves out the panel, the media group, the file `` and the colour spans. A reader who writes ``, `` or a bare `` gets that message or "no inline element of the dialect", neither of which names the spelling `adfToHtml` writes: `style="color:#rrggbb"`, no space, and ``. Name each spelling in the message of `readCarry` and in the one `readTagged` gives a `mark`, each pinned in `pinnedRefusals`.
### 174. Bound the passes `trimmedEdges` takes by a constant, so a line of alternating code and emphasized blanks trims in linear time.
@@ -249,6 +250,10 @@ Technical principle "Prefer a standalone Python script over a shell script": `AG
bash footguns (`&&` chaining under `||`, `tee /dev/stderr`) the port removes. A wrong line range in
`run.sh` mutates the wrong lines without failing, so the port tests how it reads diff hunks.
+### 187. Write a `blockTaskItem` and a nested task list as HTML in `adfToHtml` and read them back in `htmlToAdf`, in place of the carry element.
+
+The reader panel of §The HTML dialect expected a `blockTaskItem` as an `
` of two `
` and a nested task list as an inner `
`. The writer panel's spellings left both on the carry, since a task item holds inline content alone. A writer panel settles the two spellings (AGENTS.md §7); the item takes it and writes the HTML both ways.
+
### 34. Read emphasis flanking by the whole character beside an astral symbol.
Check whether `delimiterRunToken` (`inline-tokens.ts`) and `resolveEmphasis` (`line-escaping.ts`)