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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user