3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-18 22:25:44 +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
+2 -2
View File
@@ -1,5 +1,5 @@
import type { AdfNode } from '../adf/document.ts'
import { identicalMarks, isBareText, nodeMarks } from '../adf/document.ts'
import { identicalMarks, isSpellableText, nodeMarks } from '../adf/document.ts'
import { spellInlineLeafDirective } from './directive-syntax.ts'
export const textBreakName = 'textBreak'
@@ -8,5 +8,5 @@ export const textBreakSpelling = spellInlineLeafDirective(textBreakName, '')
// The lossless reader's rule: CommonMark reads the pair back as one text run (spec/flavour.md, Inline nodes).
export function joinsWhenRead(previous: AdfNode, node: AdfNode): boolean {
return isBareText(previous) && isBareText(node) && identicalMarks(nodeMarks(previous), nodeMarks(node))
return isSpellableText(previous) && isSpellableText(node) && identicalMarks(nodeMarks(previous), nodeMarks(node))
}