3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-19 14:45:44 +01:00

Answer stability round 1: 1 🔴, 1 🟡 (0 misread); nested directive contents share their paragraph's memo, and a title after <destination> needs whitespace, pinned

This commit is contained in:
2026-10-28 12:44:27 +01:00
committed by Lillem4n
parent 273c08ac08
commit 935012d475
5 changed files with 49 additions and 26 deletions
+5
View File
@@ -83,6 +83,11 @@ export function claimDirectivePrefix(text: string, index: number): ClaimedPrefix
return claimsDirectivePrefix(text, index) ? { [claimedPrefix]: true, index } : undefined
}
// Where a span's [content] starts, counted from its `!adf:`.
export function contentOffset(span: DirectiveSpan): number {
return directivePrefix.length + span.name.length + 1
}
export function holdsDirectivePrefix(text: string): boolean {
return text.includes(directivePrefix)
}