10b - a code span inside a == pair keeps code and takes no highlight

This commit is contained in:
2026-09-25 20:54:46 +02:00
parent bf87e6ea18
commit c1fed0885b
2 changed files with 11 additions and 3 deletions
+3 -1
View File
@@ -158,6 +158,8 @@ function split(inline: readonly AdfNode[], paired: readonly Delimiter[]): AdfNod
}
function pushPiece(lifted: AdfNode[], node: AdfNode, text: string, inPair: boolean): void {
const marks = inPair ? [editorHighlight, ...nodeMarks(node)] : [...nodeMarks(node)]
// Atlassian's schema refuses a highlight on code.
const highlights = inPair && !nodeMarks(node).some((mark) => mark.type === 'code')
const marks = highlights ? [editorHighlight, ...nodeMarks(node)] : [...nodeMarks(node)]
if (text !== '') lifted.push(marks.length === 0 ? { text, type: 'text' } : { marks, text, type: 'text' })
}