3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-21 15:42:58 +01:00

Answer architecture round 2: the spelling memo, headroom and the escaped backtick lengths state their rule at the code, and the highlight counter is named for what it counts

This commit is contained in:
2026-10-04 23:01:16 +02:00
committed by Lillem4n
parent 640772bc0f
commit 1ff27164f8
3 changed files with 10 additions and 8 deletions
+1
View File
@@ -124,6 +124,7 @@ function claimsHighlight(scan: string, index: number): boolean {
// CommonMark reads no escape inside a code span, so a backtick string an escape forms or splits off still closes one an earlier bare run opens.
function escapeClosedRuns(scan: string, escapings: readonly InlineEscaping[], claimed: ReadonlySet<number>): ReadonlySet<number> {
const escaped = new Set(claimed)
// The lengths of the backtick strings an escape forms or splits off: a bare run that long closes the span one opens.
const formed = new Set<number>()
let end = scan.length - 1
while (end >= 0) {