Make markdownToAdf(adfToMarkdown(doc)) deep-equal doc #156

Merged
lilleman merged 67 commits from deep-equal-round-trip into main 2026-10-03 17:56:46 +02:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 7b38eba29e - Show all commits
+1 -1
View File
@@ -64,7 +64,7 @@ export function emptyKeys(held: { attrs?: AdfAttributes; content?: AdfNode[]; ma
return keys return keys
} }
// A text node holding no attrs or content key and no empty marks: a format spells it as text, where anything more rides a carry. // A format spells this node as text; anything more rides a carry, save content, which is refused.
export function isBareText(node: AdfNode): boolean { export function isBareText(node: AdfNode): boolean {
return node.type === 'text' && node.attrs === undefined && node.content === undefined && node.marks?.length !== 0 return node.type === 'text' && node.attrs === undefined && node.content === undefined && node.marks?.length !== 0
} }
+1 -1
View File
@@ -327,7 +327,7 @@ function isTextBreak(item: Inline): item is TextBreak {
return 'kind' in item && item.kind === 'textBreak' return 'kind' in item && item.kind === 'textBreak'
} }
// The nodes the items hold, own-marks ones unwrapped and text breaks dropped. // The nodes the items hold, with text breaks dropped.
function adfNodes(items: readonly Inline[]): AdfNode[] { function adfNodes(items: readonly Inline[]): AdfNode[] {
const nodes: AdfNode[] = [] const nodes: AdfNode[] = []
for (const item of items) { for (const item of items) {