Rename isPlainText to isBareText, apart from the plain flavour, and say truly what it admits

This commit is contained in:
2026-10-03 16:19:09 +02:00
parent f7d2eb6517
commit 1791542b3c
5 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -64,8 +64,8 @@ export function emptyKeys(held: { attrs?: AdfAttributes; content?: AdfNode[]; ma
return keys
}
// A text node holding its text and marks alone: a format spells it as text, where anything more rides a carry.
export function isPlainText(node: AdfNode): boolean {
// 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.
export function isBareText(node: AdfNode): boolean {
return node.type === 'text' && node.attrs === undefined && node.content === undefined && node.marks?.length !== 0
}