diff --git a/CHANGELOG.md b/CHANGELOG.md index 10161f2..1f1f362 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- `adfToHtml` writes a `strike` mark as ``, where it wrote the carry element, and `htmlToAdf` reads + `` as `strike`. A carry element written before still reads. - `adfToPlainText` writes a document as text with no markup, for a search index, a notification or an email: blocks a blank line apart; `• ` and `1.` list markers, `☑ ` and `☐ ` for a done and an open task, nesting indented; a link's address and title in parentheses after its text; a hard break as a diff --git a/README.md b/README.md index f1606f9..0a5b92f 100644 --- a/README.md +++ b/README.md @@ -575,7 +575,7 @@ content. No stylesheet ships. The complete dialect: | `paragraph` | `

` | | `rule` | `


` | | `table`, `tableRow`, `tableCell`, `tableHeader` | ``, `` for a first row of `tableHeader` cells alone, ``, ``, `
` and ``; a cell's first paragraph stands as an item's does, and `` writes its attributes | -| `text` marked `code`, `em`, `strong` | ``, ``, ``, the first mark outermost | +| `text` marked `code`, `em`, `strike`, `strong` | ``, ``, ``, ``, the first mark outermost | | 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, 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 | diff --git a/docs/decisions.md b/docs/decisions.md index da343d3..e97b544 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -489,6 +489,10 @@ A sixth panel (2026-11-05, three readers in the same roles) picked each of these - a cell's attributes as `
`, over `data-*` for all four. +A seventh panel (2026-11-14, three readers in the same roles, after a reader panel expected `` or +``) picked `old` for a `strike` mark, 3 of 3, over `` and over a `` styled +`text-decoration:line-through`: its name says what the text is, and GFM's renderers write it for `~~`. + ## `htmlToAdf` also reads the dialect as a browser serializes it 2026-10-28, the maintainer. Goal 6. Valid while a viewer/editor app may show `adfToHtml`'s HTML in a @@ -1289,9 +1293,10 @@ the copy is refused as `unmappable-html` rather than saved. They expected: `
  • Write the spec
  • `. A `blockTaskItem` is an `
  • ` of two `

    `, a nested list an inner `

      `, and an empty item an `
    • `. -- The `strike` mark in Emphasis and strikethrough as `relay` or `relay`. +- The `strike` mark in Emphasis and strikethrough as `relay` or `relay`, which + `adfToHtml` writes as `` (§The HTML dialect). -`todo.md` items 134 and 141 will write these; their writer panels pick the spelling with these +`todo.md` item 134 will write the rest; its writer panel picks the spelling with these expectations as input. The Date row drew 1 of 3 not reasonable, so four more readers (bot, reader of the markdown, export/indexing, viewer/editor) read it, and 5 of 7 found it reasonable. `adfToLosslessMarkdown` keeps writing `!adf:date{timestamp=1756080000000}`. The two who rejected diff --git a/docs/feature-table.md b/docs/feature-table.md index 27f9ca5..e152b1c 100644 --- a/docs/feature-table.md +++ b/docs/feature-table.md @@ -77,7 +77,7 @@ An un*real*istic goal. `adfToHtml`, round-trip holds: ```html -

      Read the manual before wiring the relay.

      +

      Read the manual before wiring the relay.

      An unrealistic goal.

      ``` diff --git a/docs/reading-cost.md b/docs/reading-cost.md index 916a8db..0443a50 100644 --- a/docs/reading-cost.md +++ b/docs/reading-cost.md @@ -1093,3 +1093,20 @@ Read most (opens and searches): - `src/html/emit/adf-to-html.ts` 3 - `src/index.ts` 3 - `CHANGELOG.md` 2 + +## Reading cost, chunk 19fae36f9c33, finished 2026-11-14T22:07:18Z + +317879 new input tokens before the first commit. + +Read most (opens and searches): + +- `src/plain-text/adf-to-plain-text.test.ts` 7 +- `README.md` 5 +- `docs/decisions.md` 5 +- `todo.md` 4 +- `ci.sh` 2 +- `src/adf/shown-text.ts` 2 +- `src/html/carry-content.ts` 2 +- `src/plain-text/adf-to-plain-text.ts` 2 +- `CHANGELOG.md` 1 +- `docker-runner.sh` 1 diff --git a/spec/html.md b/spec/html.md index 967ec5f..5cd9f6b 100644 --- a/spec/html.md +++ b/spec/html.md @@ -54,7 +54,7 @@ block's `data-*` attributes stand on its `
      `.
       | ADF | HTML |
       | --- | --- |
       | `date` | ``, the day in UTC |
      -| `em`, `strong`, `code` | ``, ``, `` around the text |
      +| `em`, `strike`, `strong`, `code` | ``, ``, ``, `` around the text |
       | `emoji` | `🎉`, its `text` the content |
       | `hardBreak` | `
      ` | | `inlineCard`, holding a `url` | `https://example.com/spec` | diff --git a/src/html/emit/adf-to-html.test.ts b/src/html/emit/adf-to-html.test.ts index f8bfe62..49456e8 100644 --- a/src/html/emit/adf-to-html.test.ts +++ b/src/html/emit/adf-to-html.test.ts @@ -75,6 +75,11 @@ test('writes the marks CommonMark spells, the first mark outermost', () => { assert.equal(html(adfToHtml(document(paragraph(text('Line one'), { type: 'hardBreak' }, text('Line two'))))), '

      Line one
      Line two

      \n') }) +test('writes a strike mark as , a strike mark holding attributes as a carry element', () => { + assert.equal(html(adfToHtml(document(paragraph(text('old', { type: 'strike' }), text(' new', { type: 'strong' }, { type: 'strike' }))))), '

      old new

      \n') + assert.match(html(adfToHtml(document(paragraph(text('old', { attrs: { x: 1 }, type: 'strike' }))))), /^

      { assert.equal(html(adfToHtml(document(paragraph(text('a < b && c > "d" \'e\'\tf\ng\fh'))))), '

      a < b && c > "d" \'e\'\tf\ng\fh

      \n') }) diff --git a/src/html/mark-elements.ts b/src/html/mark-elements.ts index bbc15b9..201b287 100644 --- a/src/html/mark-elements.ts +++ b/src/html/mark-elements.ts @@ -2,6 +2,7 @@ const markElements: ReadonlyMap = new Map([ ['code', 'code'], ['em', 'em'], + ['strike', 'del'], ['strong', 'strong'], ]) diff --git a/src/html/parse/html-to-adf.test.ts b/src/html/parse/html-to-adf.test.ts index bfb3581..c5edfdf 100644 --- a/src/html/parse/html-to-adf.test.ts +++ b/src/html/parse/html-to-adf.test.ts @@ -80,6 +80,10 @@ test('reads text\'s marks from its elements, the outermost first, and each run o assert.deepEqual(read(htmlToAdf('

      y

      \n')), document(paragraph(text('y', { attrs: { href: 'x', title: '' }, type: 'link' })))) }) +test('reads as a strike mark', () => { + assert.deepEqual(read(htmlToAdf('

      old new

      \n')), document(paragraph(text('old', { type: 'strike' }), text(' new', { type: 'strong' }, { type: 'strike' })))) +}) + test('reads escaped text, and keeps tabs, line feeds and form feeds', () => { assert.deepEqual(read(htmlToAdf('

      a < b && c > "d" \'e\'\tf\ng\fh &lt;

      \n')), document(paragraph(text('a < b && c > "d" \'e\'\tf\ng\fh <')))) }) diff --git a/todo.md b/todo.md index 4b1d697..3093025 100644 --- a/todo.md +++ b/todo.md @@ -12,7 +12,6 @@ | ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score | |---|---|---|---|---|---|---|---|---|---|---|---| -| 141 | 0.4.0 | | decision | **Write `strike` as HTML in `adfToHtml` and read it back in `htmlToAdf`, in place of the carry element.** | 1 | 1 | 1 | 1 | 2 | 6 by 2 | 3.2 | | 135 | 0.4.0 | | | **Write media, media groups and captions as semantic HTML in `adfToHtml` and read them back in `htmlToAdf`, in place of the carry element.** | 2 | 2 | 2 | 4 | 4 | 6 by 2 | 1.6 | | 136 | 0.4.0 | | | **Write underline, text and background colours, subscript, superscript, alignment and indentation as HTML in `adfToHtml` and read them back in `htmlToAdf`, in place of the carry element.** | 2 | 2 | 2 | 4 | 4 | 6 by 2 | 1.6 | | 134 | 0.4.0 | | decision | **Write panels, expands, task lists and decision lists as semantic HTML in `adfToHtml` and read them back in `htmlToAdf`, in place of the carry element.** | 2 | 2 | 2 | 4 | 5 | 6 by 3 | 1.5 | @@ -49,12 +48,6 @@ ## Details -### 141. Write `strike` as HTML in `adfToHtml` and read it back in `htmlToAdf`, in place of the carry element. - -GFM spells `strike`, and no other HTML item writes it: `adfToHtml` writes only the marks CommonMark -spells. A writer panel picks `` or ``. A reader panel (`docs/decisions.md`, the -feature-table entry) expected `` or ``, and the writer panel takes that as input. - ### 135. Write media, media groups and captions as semantic HTML in `adfToHtml` and read them back in `htmlToAdf`, in place of the carry element. A writer panel picks the spellings; a plain external image already has one, `

      `.