3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-12 11:48:29 +01:00

Say the card refusal holds only in a block written as an element

This commit is contained in:
2026-11-04 19:52:37 +01:00
parent be5d177a62
commit c06d5a3e99
3 changed files with 10 additions and 8 deletions
+3 -2
View File
@@ -17,8 +17,9 @@
`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. `adfToHtml` refuses an inline card a link marks, as `unsupported-node-shape`: Atlassian's schema gives a
card no link mark, and HTML nests no link in a link.
showing it. `adfToHtml` refuses an inline card a link marks, in a block written as an element, as
`unsupported-node-shape`: Atlassian's schema gives a card no link mark, and HTML nests no link in
a link.
- `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
+4 -3
View File
@@ -526,7 +526,7 @@ content. No stylesheet ships. The complete dialect:
| `rule` | `<hr>` |
| `text` marked `code`, `em`, `strong` | `<code>`, `<em>`, `<strong>`, the first mark outermost |
| an attribute its type holds that its element does not write, such as `localId`, on a paragraph, heading, quote, list, list item, code block, rule, emoji, mention, status, date or card | `data-*` named as HTML's `dataset` names it: `<p data-local-id="a1f3">` |
| any other node, or a node holding what its element cannot, except an inline card a link marks, which is refused | `<div class="adf-carry" data-adf="{…}"><p>its content</p></div>`, a `<span>` inline |
| any other node, or a node holding what its element cannot, except an inline card a link marks in a block written as an element, which is refused | `<div class="adf-carry" data-adf="{…}"><p>its content</p></div>`, a `<span>` inline |
- Every URL is written as the ADF holds it, `javascript:` included: a link's, an image's, a
card's, and a carried link's in the carry element. Sanitize the HTML before showing a document from
@@ -646,8 +646,9 @@ Every call can raise these:
twice, a block or a non-text inline node holding `text`, or a leaf block or a non-text inline node
holding `content`. Keep the ADF and show the document read-only; where you built the ADF, fix
what the message names.
- **Writing, in `adfToHtml`**: an inline card marked by a link: Atlassian's schema gives a card no
link mark, and HTML nests no link in a link. Keep the ADF and show the document read-only; where
- **Writing, in `adfToHtml`**: an inline card marked by a link, in a block written as an element
(in a carried block it rides the carry): Atlassian's schema gives a card no link mark, and HTML
nests no link in a link. Keep the ADF and show the document read-only; where
you built the ADF, remove the link mark from the card the error's `path` names.
- **Writing, in `adfToPortableMarkdown`**: a line or task list the portable writer cannot spell.
This is a bug in this library: report it.
+3 -3
View File
@@ -107,9 +107,9 @@ later release writes it as its own element.
- Characters HTML cannot hold are dropped.
- A node rides the carry where it holds a mark or a key its element does not write, an attribute
its type does not hold as that kind, an empty `attrs`, `content` or `marks`, or a value its
element cannot hold. The exception is an inline card a link marks, which `adfToHtml` refuses as
`unsupported-node-shape`: Atlassian's schema gives a card no link mark, and HTML nests no link in
a link.
element cannot hold. The exception is an inline card a link marks, in a block written as an element:
`adfToHtml` refuses it as `unsupported-node-shape`, since Atlassian's schema gives a card no link
mark and HTML nests no link in a link. In a carried block it rides the carry.
- text holding no character, or a character HTML cannot hold; text holding a mark twice, or a
mark with attributes besides a link's `href` and `title`;
- an unmarked text node straight after one written as plain text, which would read back as one;