From 5db3155fe8eb4bd2a5c38c410e9644284e25916e Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 4 Nov 2026 19:55:21 +0100 Subject: [PATCH] Say why the card guard refuses, and keep the spec's carry causes under their lead-in --- spec/html.md | 7 ++++--- src/html/emit/inline.ts | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/html.md b/spec/html.md index ddd1b49..bf201df 100644 --- a/spec/html.md +++ b/spec/html.md @@ -107,9 +107,7 @@ 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, 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. + element cannot hold: - 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; @@ -129,6 +127,9 @@ later release writes it as its own element. - a list holding a node that is no `listItem`, or an item holding a mark, text, an empty key or an attribute its type does not hold: the whole list rides the carry; - a `listItem` outside a list, an inline node in block position and a block node inline. +- An inline card a link marks, in a block written as an element, is refused as + `unsupported-node-shape` instead: 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. - A block carry's JSON nests at most 500 levels less the depth it stands at, an inline carry's at most 500, as in markdown. diff --git a/src/html/emit/inline.ts b/src/html/emit/inline.ts index 6704faf..eb690b2 100644 --- a/src/html/emit/inline.ts +++ b/src/html/emit/inline.ts @@ -12,6 +12,7 @@ export function inlineHtml(nodes: readonly AdfNode[], path: ConvertErrorPath): R let html = '' let afterPlainText = false for (const [index, node] of nodes.entries()) { + // Refused, not carried: HTML nests no link in a link. A card in a carried block never reaches here. if (node.type === 'inlineCard' && nodeMarks(node).some(({ type }) => type === 'link')) { return failure('unsupported-node-shape', 'an inlineCard takes no link mark: this one holds one', [...path, 'content', index]) }