3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-21 15:42:58 +01:00

Answer product-owner round 1: 0 🔴, 1 🟡 (0 misread); describe a data card as adfToHtml writes it

This commit is contained in:
2026-11-04 16:44:10 +01:00
parent ac1cbaad27
commit 4bc24140da
3 changed files with 19 additions and 16 deletions
+9 -8
View File
@@ -10,19 +10,20 @@
- `adfToHtml` writes ADF as HTML: paragraphs, headings, lists, quotes, code blocks, rules, hard
breaks, a centered, uncaptioned external image holding no attribute but its URL and alt, and
`em`, `strong`, `code` and links as their elements. An unmarked emoji, mention, status, date
and card holding a URL or `data`, not both, are `<span class="adf-emoji">`,
and card holding a URL, or `data` holding one, not both, are `<span class="adf-emoji">`,
`<span class="adf-mention">`, `<span class="adf-status">`, `<time class="adf-date">` and
`<a class="adf-inline-card">`. A paragraph, heading, quote, list, list item, code block, rule,
emoji, mention, status, date or card writes its other attributes as `data-*`
attributes, `localId` as `data-local-id`. Every other node is an element of class `adf-carry` holding the node's JSON in `data-adf` and showing its
content, links included. Every URL is written as the ADF holds it,
`javascript:` included: sanitize HTML from an author you do not trust before showing it.
emoji, mention, status, date or card writes its other attributes as `data-*` attributes,
`localId` as `data-local-id`. Every other node is an element of class `adf-carry` holding the
node's JSON in `data-adf` and showing its content, links included. Every URL is written as the
ADF holds it, `javascript:` included: sanitize HTML from an author you do not trust before
showing it.
- `htmlToAdf` reads `adfToHtml`'s HTML back to the document it came from, a carry element from its
`data-adf`. It reads that HTML as a browser's `innerHTML` writes it too (a raw `"` in text,
`&nbsp;`, a raw `<` or `>` in an attribute value) and as a form post sends it (`\r\n` for each
line feed). An edit to an emoji's, mention's or status's text becomes its `text`; an edit to a date's or a
card's text alone is refused. It refuses any other HTML, including an edit to what a carry element
shows, with the codes README §The calls lists.
line feed). An edit to an emoji's, mention's or status's text becomes its `text`; an edit to a
date's or a card's text alone is refused. It refuses any other HTML, including an edit to what a
carry element shows, with the codes README §The calls lists.
- **Breaking:** `losslessMarkdownToAdf` gives a `date`, `emoji`, `inlineCard`, `mention`, `status`
or `mediaInline` only the marks Atlassian's schema lets it hold: `**!adf:mention[@A]{id=…}**` now
reads as a plain mention. A link or directive mark around only nodes that cannot take it is