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

Read deep list items' blank lines and a directive's unclosed backtick runs in time linear in the markdown

This commit is contained in:
2026-10-18 11:15:30 +02:00
committed by Lillem4n
parent a9cdd70365
commit d82b7abb3f
11 changed files with 119 additions and 71 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
import type { ClaimedPrefix } from './directive-syntax.ts'
import type { Claims } from './portable/conventions.ts'
import { backslashEscape, inlineHtmlConstruct, readBracketedAutolink, readEmailAutolink } from './commonmark/grammar.ts'
import { backtickCloser, backtickRun } from './commonmark/backtick-runs.ts'
import { backtickCloser, backtickRun, type CodeSpanCloser } from './commonmark/backtick-runs.ts'
import { claimDirectivePrefix } from './directive-syntax.ts'
import { delimiterFlags, runLength } from './commonmark/emphasis-matching.ts'
import { highlightDelimiter, highlightFlanking } from './portable/conventions.ts'
@@ -20,7 +20,7 @@ export type InlineToken =
// Build one per text and pass it to every `readInlineToken` call on that text, so a walk stays linear in the text's length.
export type InlineSource = {
readonly codeSpanCloser: (from: number, opener: number) => number | undefined
readonly codeSpanCloser: CodeSpanCloser
// Where each HTML terminator last starts in the text, -1 for none; filled the first time an opener asks.
readonly terminators: Map<string, number>
readonly text: string