3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-13 04:08:29 +01:00

Answer architecture round 2: rename isBareText to isSpellableText, say which link holdsLink counts, the README names the type passed

This commit is contained in:
2026-10-05 09:32:11 +02:00
committed by Lillem4n
parent 41ac4510f5
commit a62cd39809
7 changed files with 15 additions and 16 deletions
+3 -3
View File
@@ -66,12 +66,12 @@ export function emptyKeys(held: { attrs?: AdfAttributes; content?: AdfNode[]; ma
}
// No attrs, content or empty marks; a format may spell this node as text, and anything more rides a carry.
export function isBareText(node: AdfNode): boolean {
export function isSpellableText(node: AdfNode): boolean {
return node.type === 'text' && node.attrs === undefined && node.content === undefined && node.marks?.length !== 0
}
export function isUnmarkedBareText(node: AdfNode): boolean {
return isBareText(node) && node.marks === undefined
export function isUnmarkedSpellableText(node: AdfNode): boolean {
return isSpellableText(node) && node.marks === undefined
}
export function identicalMark(left: AdfMark, right: AdfMark): boolean {