3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-18 22:25:44 +01:00

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 d4d9cdf112
commit 72f919ae04
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
}