From f5c8a4870643f40663e4dcdab5109ce00668a5af Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 15 Nov 2026 00:03:44 +0100 Subject: [PATCH] Write media, colours, alignment, panels, expands and task lists as HTML in adfToHtml and read them back in htmlToAdf --- CHANGELOG.md | 12 ++ README.md | 15 +- docs/decisions.md | 23 ++- docs/feature-table.md | 17 ++- docs/reading-cost.md | 17 +++ spec/html.md | 41 ++++- src/html/alignment-element.ts | 33 +++++ src/html/block-classes.ts | 35 +++++ src/html/cell-element.ts | 8 +- src/html/colour-style.ts | 15 ++ src/html/emit/adf-to-html.test.ts | 231 ++++++++++++++++++++++++++--- src/html/emit/adf-to-html.ts | 97 +++++++++++- src/html/emit/inline.ts | 8 +- src/html/first-paragraph.ts | 4 +- src/html/mark-elements.ts | 47 +++++- src/html/media-element.ts | 92 ++++++++++++ src/html/parse/html-to-adf.test.ts | 164 +++++++++++++++++++- src/html/parse/html-to-adf.ts | 99 +++++++++---- src/html/parse/inline-block.ts | 37 +++++ src/html/parse/inline.ts | 9 +- src/html/parse/media-block.ts | 71 +++++++++ src/html/parse/task-item.ts | 62 ++++++++ src/html/task-element.ts | 22 +++ todo.md | 26 +--- 24 files changed, 1062 insertions(+), 123 deletions(-) create mode 100644 src/html/alignment-element.ts create mode 100644 src/html/block-classes.ts create mode 100644 src/html/colour-style.ts create mode 100644 src/html/media-element.ts create mode 100644 src/html/parse/inline-block.ts create mode 100644 src/html/parse/media-block.ts create mode 100644 src/html/parse/task-item.ts create mode 100644 src/html/task-element.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e5d845..a232e70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ ## Unreleased +- `adfToHtml` writes a media single, a media group and a caption as `
` holding an + `` and a `
`, and as `
` of `` files, where + `0.3.1` wrote the carry element, and `htmlToAdf` reads them back. A link around the image is the media's link + 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 `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. +- `adfToHtml` writes a panel as `
`, an expand and a nested expand as `
` with the + title in a ``, a task list as `