Read the emphasis, the links and the lone image CommonMark spells (#34)
CI / gate (push) Successful in 5s

This commit was merged in pull request #34.
This commit is contained in:
2026-08-31 22:33:54 +02:00
parent 0476d33b7b
commit 4ad80e79c5
31 changed files with 899 additions and 218 deletions
+1 -8
View File
@@ -1,5 +1,5 @@
import { backtickRun, closingBacktickRun } from '../backtick-runs.ts'
import { delimiterFlags, isWordCharacter, matchEmphasis } from '../emphasis-matching.ts'
import { delimiterFlags, isWordCharacter, matchEmphasis, runLength } from '../emphasis-matching.ts'
import { backslashEscape, escapesLineClaim, inlineHtmlConstruct, opensBracketedAutolink, opensEmailAutolink, type LinePosition } from '../commonmark-grammar.ts'
import { opensInlineDirective } from '../directive-attributes.ts'
import { readEntityReference } from '../entity-references.ts'
@@ -260,13 +260,6 @@ function startsRun(scan: string, index: number, escaped: ReadonlySet<number>): b
return scan.charAt(index - 1) !== scan.charAt(index)
}
function runLength(scan: string, index: number): number {
const character = scan.charAt(index)
let length = 0
while (scan.charAt(index + length) === character) length += 1
return length
}
function charAt(text: string, index: number): string {
return index < 0 ? '' : text.charAt(index)
}