/** * Streaming tail repair — the "remend" step for the incremental markdown engine. * * The incremental parser calls {@link repairMarkdownTail} on the *unsettled tail* * of the stream before parsing it, so half-arrived syntax renders as its settled * form instead of flickering (a dangling `**bold` shows as bold immediately, not * as two literal asterisks that vanish on the next chunk). * * Hard invariant: on text that already ends in complete syntax the function is an * exact no-op (returns the input unchanged). That is what keeps the streamed end * state identical to a one-shot parse of the full source. The function is also * idempotent — `repairMarkdownTail(repairMarkdownTail(x)) === repairMarkdownTail(x)`. * * Scope: this operates on the CommonMark/GFM subset the engine renders. Raw HTML * is plain text here (no tag balancing), and `$$` math is ordinary text — neither * is repaired. Open fenced code blocks are left entirely untouched so the block * parser can keep rendering them as an open code block. */ /** * Repair the unsettled tail of a streamed markdown source: close unpaired inline * markers and drop half-arrived links/images. A no-op on complete syntax. */ export declare function repairMarkdownTail(text: string): string;