From 4bf5d8a9d19a6645b3aefbafcd83fe89e43c6e3e Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 15 Nov 2026 13:21:36 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20prose=20round=201:=200=20=F0=9F=94=B4,?= =?UTF-8?q?=206=20=F0=9F=9F=A1=20(0=20misread);=20mark=20the=20cell=20back?= =?UTF-8?q?ground=20breaking,=20reword=20the=20panel=20entries=20and=20the?= =?UTF-8?q?=20alignment=20refusal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 11 ++++++----- docs/decisions.md | 14 ++++++++------ spec/html.md | 4 ++-- src/html/text-block-attributes.ts | 2 +- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba621b8..6f90c17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,11 +8,12 @@ mark. The carry element `0.3.1` wrote for them still reads. - `adfToHtml` writes underline as ``, subscript and superscript as `` and ``, a text colour as ``, a background colour as `` and a paragraph's or - heading's alignment as `data-align="center"` or `data-align="end"`, where `0.3.1` wrote the carry element, and `htmlToAdf` reads them - back. The carry element `0.3.1` wrote for them still reads. -- `adfToHtml` writes a table cell's background as `data-background-color="…"`, where `0.3.1` wrote - `style="background-color:…"`, so the HTML holds no `style` attribute. `htmlToAdf` still reads the `0.3.1` spelling. - A background that isn't letters and digits after an optional `#` is written too, where it rode the carry element. + heading's alignment as `data-align="center"` or `data-align="end"`, where `0.3.1` wrote the carry element, + and `htmlToAdf` reads them back. The carry element `0.3.1` wrote for them still reads. +- **Breaking:** `adfToHtml` writes a table cell's background as `data-background-color="…"`, where `0.3.1` wrote + `style="background-color:…"`, so the HTML holds no `style` attribute and a browser no longer shows the colour + unaided. `htmlToAdf` still reads the `0.3.1` spelling. A table whose cell background isn't letters and digits after + an optional `#` is written too, where `0.3.1` wrote the whole table as the carry element. - `htmlToAdf` names every spelling of the dialect's `
`, `` and `` in the refusal of one it can't read. - `adfToHtml` writes a paragraph's or heading's indentation as `data-indent-level="2"`, where `0.3.1` wrote the carry diff --git a/docs/decisions.md b/docs/decisions.md index 8a7f157..d0547ea 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -486,9 +486,10 @@ A sixth panel (2026-11-05, three readers in the same roles) picked each of these - a first row of header cells alone in `` and the rest in ``, a row to a line, over a bare `` of `` rows and over a line per cell; - a cell's first paragraph bare, ``, as a list item's; -- a cell's attributes as `
Bolt M8` and `data-*` attributes, over `data-*` for all four; its - `style="background-color:…"` gave way to the ninth panel's spelling, and `htmlToAdf` still reads it, since - `0.3.1` wrote it and every other spelling `0.3.1` wrote still reads. +- a cell's `colspan` and `rowspan` as ``, over `data-*` attributes for them. + +The sixth panel also picked `style="background-color:…"` for a cell's background. The ninth panel's spelling +replaced it. `htmlToAdf` still reads it, since `0.3.1` wrote it and every other spelling `0.3.1` wrote still reads. A seventh panel (2026-11-14, three readers in the same roles, after the reader panel of §The feature table is a section per corpus example, led by a summary table expected `` or ``) picked @@ -520,10 +521,11 @@ naming what it holds, over a class beside it and over a class per value: - `data-align="center"` and `data-align="end"` for an `alignment`, ADF's own values; - `` and ``, over a bare `data-color` that could name either; -- `` for a cell's `background`, the highlight's name over ADF's. +- `` for a cell's `background`, the name the background colour mark takes, + over ADF's attribute name. -Out of `style`, a colour needs no restriction to stay in its attribute, so any string HTML can hold -is one. +A colour outside `style` cannot break out of its attribute, so `adfToHtml` writes any colour string HTML can +hold. ## `htmlToAdf` also reads the dialect as a browser serializes it diff --git a/spec/html.md b/spec/html.md index d7a2a08..935652f 100644 --- a/spec/html.md +++ b/spec/html.md @@ -196,8 +196,8 @@ what it shows too: | a line feed | `\r\n` | | an expand's or nested expand's `
` | the same with `open=""` after its other attributes, which a browser writes for one its user opened; it reads as the same expand, the open state dropped | -`htmlToAdf` also reads a cell's `background` as `0.3.1` wrote it, `style="background-color:#fffae6"` in -the place of `data-background-color`, the colour a `#` and letters and digits, or letters and digits alone. +`htmlToAdf` also reads a cell's `background` as `0.3.1` wrote it: `style="background-color:#fffae6"`, where +`data-background-color` stands. The colour is letters and digits after an optional `#`. A refusal's position counts the HTML as handed in. `htmlToAdf` reads a carry element's node from its `data-adf`, and what the element shows, through its closing tag, must be what `adfToHtml` shows for diff --git a/src/html/text-block-attributes.ts b/src/html/text-block-attributes.ts index 39cfddd..c078cca 100644 --- a/src/html/text-block-attributes.ts +++ b/src/html/text-block-attributes.ts @@ -35,7 +35,7 @@ export function readTextBlockAttributes(pairs: readonly (readonly [string, strin const mark = first === undefined ? undefined : readMark(first, element) if (mark?.fault !== undefined) return mark const rest = mark === undefined ? pairs : pairs.slice(1) - if (rest.some(([name]) => name === alignAttribute || name === indentAttribute)) return { fault: { code: 'unmappable-html', message: `<${element}> takes one of ${alignAttribute} and ${indentAttribute}, first, before its data-* attributes` } } + if (rest.some(([name]) => name === alignAttribute || name === indentAttribute)) return { fault: { code: 'unmappable-html', message: `<${element}> holds at most one of ${alignAttribute} and ${indentAttribute}, as its first attribute` } } const data = readDataAttributes(rest, element, vocabulary, written) if (data.fault !== undefined) return data return { value: { attrs: data.value, marks: mark === undefined ? [] : [mark.value] } }