3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-19 14:45:44 +01:00

Answer product-owner round 1: 0 🔴, 3 🟡 (0 misread); name the fix each refusal needs, list the card's href as an unfiltered URL, carry dates outside years 1 to 9999

This commit is contained in:
2026-11-04 13:45:29 +01:00
committed by Lillem4n
parent d67a935230
commit 731b10fdea
7 changed files with 48 additions and 29 deletions
+8 -9
View File
@@ -35,7 +35,7 @@ block's `data-*` attributes stand on its `<pre>`.
| ADF | HTML |
| --- | --- |
| `date` | `<time class="adf-date" datetime="2025-08-25" data-timestamp="1756080000000">2025-08-25</time>`, the day in UTC; its other attributes after the class, as below |
| `date` | `<time class="adf-date" datetime="2025-08-25" data-timestamp="1756080000000">2025-08-25</time>`, the day in UTC |
| `em`, `strong`, `code` | `<em>`, `<strong>`, `<code>` around the text |
| `emoji` | `<span class="adf-emoji" data-id="1f389" data-short-name=":tada:">🎉</span>`, its `text` the content |
| `hardBreak` | `<br>` |
@@ -45,10 +45,7 @@ block's `data-*` attributes stand on its `<pre>`.
| `text` | its text, escaped |
A `date`, `emoji`, `inlineCard` or `status` writes each other attribute its type holds as a
`data-*` attribute, named and sorted as on a block, `data-local-id` among them. It rides the carry
where it holds a mark, `content`, a key or value its type does not hold, or an empty `attrs`; where
it has no text to show (an emoji or status with no `text`, a date whose `timestamp` names no day, a
card with no `url`); and where a card holds `data`. A `mention` rides the carry.
`data-*` attribute, named and sorted as on a block, `data-local-id` among them.
A text node's marks nest in the order its `marks` array lists them, the first outermost:
`<strong><em>manual</em></strong>`. Each text node writes its own elements, so two text nodes a link
@@ -59,7 +56,7 @@ marks are two `<a>` elements.
Text and attribute values escape `&`, `<`, `>` and `"` as `&amp;`, `&lt;`, `&gt;` and `&quot;`.
Attribute values are double-quoted. Every URL is written as the ADF holds it, whatever its scheme
(`docs/decisions.md` §HTML writes a URL as the ADF holds it, whatever its scheme): a link's `href`,
an image's `src`, and the `href` of each link a carry element shows.
an image's `src`, a card's `href`, and the `href` of each link a carry element shows.
HTML text and attribute values cannot hold these (WHATWG HTML §13.1.3): any control but a tab, line
feed or form feed, so a carriage return too, which a parser reads as a line feed; a noncharacter;
@@ -118,6 +115,8 @@ later release writes it as its own element.
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 or status with no `text`, a date whose `timestamp` names no day from year 1 to 9999,
and a card with no `url` or holding `data`;
- a code block holding more than one text node, a marked one, or a language holding ASCII
whitespace;
- a rule or hard break holding `content`, and a hard break holding an attribute;
@@ -148,9 +147,9 @@ that node in either spelling: an edit there would be lost, so it is `unmappable-
- Any other HTML is `unmappable-html`: another element, attribute or escape, attributes in another
order, a block on the line of another, a carriage return not followed by a line feed, or
non-empty HTML not ending in a line feed.
- An emoji, status, date or card element reads back as its node only when it shows what `adfToHtml`
writes for it: the text is not empty, a date's `datetime` and text are the day its `data-timestamp`
names, and a card's `href` and text are one URL. Another shape is `unmappable-html`.
- An emoji, status, date or card element with empty text, a date whose `datetime` or text is not the
day its `data-timestamp` names, and a card whose `href` and text are not one URL are
`unmappable-html`.
- A `data-*` attribute that its element does not take, such as `data-level` on `<h1>`, or that holds
a value outside its attribute's kind or not written as compact JSON, is `unsupported-node-shape`.
- A carry element's `data-adf` holding invalid JSON is `unmappable-html`. JSON that is no ADF node,