From ed03d42d8b63d157c2b8471761a616a33152c184 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 15 Nov 2026 11:28:38 +0100 Subject: [PATCH] Write indentation as data-indent-level in HTML and read an opened details as the same expand --- AGENTS.md | 2 +- CHANGELOG.md | 5 ++- README.md | 5 +-- docs/decisions.md | 13 ++++--- spec/html.md | 7 ++-- src/html/alignment-element.ts | 36 -------------------- src/html/emit/adf-to-html.test.ts | 20 +++++++++-- src/html/emit/adf-to-html.ts | 2 +- src/html/first-paragraph.ts | 2 +- src/html/parse/html-to-adf.test.ts | 19 +++++++++-- src/html/parse/html-to-adf.ts | 5 +-- src/html/parse/inline-block.ts | 4 +-- src/html/text-block-attributes.ts | 54 ++++++++++++++++++++++++++++++ todo.md | 23 ++++--------- 14 files changed, 122 insertions(+), 75 deletions(-) delete mode 100644 src/html/alignment-element.ts create mode 100644 src/html/text-block-attributes.ts diff --git a/AGENTS.md b/AGENTS.md index 16c45a9..193a783 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -40,7 +40,7 @@ In `docs/decisions.md`: - The portable reader refuses what GFM's reading would drop - The portable reader reads what GFM's reading keeps - The HTML dialect -- `htmlToAdf` also reads the dialect as a browser serializes it +- `htmlToAdf` also reads the dialect as a browser serializes it, and an opened `
` as the same expand - No runtime dependencies - Standards ship as data - fast-check diff --git a/CHANGELOG.md b/CHANGELOG.md index a232e70..1d7dc48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,10 @@ - `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 `style="text-align:…"`, where `0.3.1` wrote the carry element, and `htmlToAdf` reads them - back. The carry element `0.3.1` wrote for them still reads. Indentation still rides the carry element. + back. The carry element `0.3.1` wrote for them still reads. +- `adfToHtml` writes a paragraph's or heading's indentation as `data-indent-level="2"`, where `0.3.1` wrote the carry + element, and `htmlToAdf` reads it back. `htmlToAdf` also reads `
`, as a browser writes an expand its + user opened, as the same expand. - `adfToHtml` writes a panel as `
`, an expand and a nested expand as `
` with the title in a ``, a task list as `