mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-21 15:42:58 +01:00
Answer prose round 1: 0 🔴, 8 🟡 (0 misread); correct the panel count, say which node rides the carry, list the new nodes' data-* attributes
This commit is contained in:
+10
-9
@@ -8,19 +8,20 @@
|
||||
to or from markdown, wrappers and forks aside; its second table lists other ecosystems'
|
||||
libraries and Atlassian's own paths.
|
||||
- `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, an
|
||||
emoji, a status, a date and a card holding only a URL (`<span class="adf-emoji">`, `<span class="adf-status">`,
|
||||
`<time class="adf-date">`, `<a class="adf-inline-card">`), and `em`, `strong`, `code` and links as
|
||||
their elements. A paragraph, heading, quote, list, list item, code block or
|
||||
rule 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
|
||||
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, status, date and card
|
||||
holding a URL and no `data` are `<span class="adf-emoji">`, `<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, 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`, and those elements. It reads that HTML as a browser's `innerHTML` writes it too (a raw `"` in text,
|
||||
`data-adf`. It reads that HTML as a browser's `innerHTML` writes it too (a raw `"` in text,
|
||||
` `, a raw `<` or `>` in an attribute value) and as a form post sends it (`\r\n` for each
|
||||
line feed). 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 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
|
||||
|
||||
Reference in New Issue
Block a user