@ai-react-markdown/engine 2.3.3 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +181 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +72 -20
- package/dist/index.d.ts +72 -20
- package/dist/index.dev.cjs +181 -34
- package/dist/index.dev.cjs.map +1 -1
- package/dist/index.dev.js +180 -34
- package/dist/index.dev.js.map +1 -1
- package/dist/index.js +180 -34
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -184,7 +184,10 @@ declare const defaultUrlTransform: UrlTransform;
|
|
|
184
184
|
* tracked outside fences; while any tag, comment, or raw block
|
|
185
185
|
* (`<?…?>` / `<!DECL…>` / `<![CDATA[…]]>` — CommonMark html block types
|
|
186
186
|
* 3–5) is open, candidates are blocked. Line-truncated tag starts
|
|
187
|
-
* (`<div` at EOL, attributes wrapping) count as opens.
|
|
187
|
+
* (`<div` at EOL, attributes wrapping) count as opens. Closers that
|
|
188
|
+
* OVERLAP their opener (`<!-->`, `<!--->`, line-start `<?>`) close on
|
|
189
|
+
* the spot — CommonMark and parse5 agree — so the markup after them is
|
|
190
|
+
* scanned, not skipped as construct interior.
|
|
188
191
|
* 2. **`$$` flow math** — remark-math's flow math swallows blank lines and
|
|
189
192
|
* runs to EOF when unclosed (verified empirically); its closing fence
|
|
190
193
|
* must sit at LINE START (a mid-line `$$` does not close it). Math
|
|
@@ -218,16 +221,24 @@ declare const defaultUrlTransform: UrlTransform;
|
|
|
218
221
|
* reproduced on v1.8.0). The candidate adjacent to such a run is
|
|
219
222
|
* rejected until a later confirmed content line pins the seam from the
|
|
220
223
|
* frozen side; dropping candidates only over-blocks (safe direction).
|
|
224
|
+
* A type 2-5 block that opens AND closes on its first line owns the
|
|
225
|
+
* rest of that line as raw content too (`<!-- c --> tail`) — same seam.
|
|
221
226
|
* 7. **Phase poison** (`phasePoisonedAt`) — points where this line-level
|
|
222
227
|
* model may have DIVERGED from micromark and provably cannot resync:
|
|
223
228
|
* a fence/math open suppressed by `htmlFlowSinceBlank` (only certainly
|
|
224
229
|
* swallowed at top level — in a container it really opens and the
|
|
225
230
|
* open/close phase inverts permanently), and a paragraph-inline `<!--`
|
|
226
231
|
* that fails to close by end of line (literal text to micromark, but
|
|
227
|
-
* the comment scan would skip real markup as comment interior)
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
232
|
+
* the comment scan would skip real markup as comment interior), and
|
|
233
|
+
* every point where CommonMark's terminator and parse5's tokenizer
|
|
234
|
+
* DISAGREE about where a raw construct ends (`--!>` closes a comment
|
|
235
|
+
* for parse5 only; a `<?…`/`<![CDATA[…` bogus comment ends at its
|
|
236
|
+
* first `>` for parse5 but at `?>`/`]]>` for CommonMark; a paragraph-
|
|
237
|
+
* inline `<?>` is open to micromark, closed to parse5) — the bytes in
|
|
238
|
+
* between are raw text to one grammar and real markup to the other, and
|
|
239
|
+
* the hast is parse5's. Every candidate past the first such point is
|
|
240
|
+
* rejected, sticky; candidates at or before it stay valid — the
|
|
241
|
+
* ambiguous region then re-parses inside the tail (pure over-block).
|
|
231
242
|
*
|
|
232
243
|
* ## Incremental scanning (checkpoint resume)
|
|
233
244
|
*
|
|
@@ -353,6 +364,12 @@ interface FreezeScanCheckpoint {
|
|
|
353
364
|
inMath: boolean;
|
|
354
365
|
/** Opening dollar-run length while inMath — the close run must match it. */
|
|
355
366
|
mathFenceLen: number;
|
|
367
|
+
/** Indent (0-3 spaces) of the line that opened the current fence/math
|
|
368
|
+
* block. Not a blocker input — read by `phantomSuffixCloser` to emit a
|
|
369
|
+
* closer at the SAME indent, which closes the block whether it sits at
|
|
370
|
+
* top level (≤3 spaces are allowed there) or inside a list item whose
|
|
371
|
+
* content indent the opener line already satisfies. */
|
|
372
|
+
openIndent: number;
|
|
356
373
|
blankRun: number;
|
|
357
374
|
lastBlankStart: number;
|
|
358
375
|
/** Rolling blocker-3 verdict ("nearest decisive block start so far"). */
|
|
@@ -392,6 +409,10 @@ interface FreezeScanCheckpoint {
|
|
|
392
409
|
* ambiguous tag names stays, but it decays at the next decisive block
|
|
393
410
|
* start — this field is the phase-corruption backstop that does not. */
|
|
394
411
|
phasePoisonedAt: number;
|
|
412
|
+
/** Tag names of line-truncated opens (`<div` at EOL) counted into
|
|
413
|
+
* tagBalance but not yet confirmed by a later `>` — reverted at the next
|
|
414
|
+
* blank line (a tag cannot span one). See TRUNCATED_TAG_RE. */
|
|
415
|
+
pendingTruncatedTags: string[];
|
|
395
416
|
}
|
|
396
417
|
declare function computeFreezeBoundary(text: string, options: FreezeBoundaryOptions, resume?: FreezeScanCheckpoint | null): FreezeScanResult;
|
|
397
418
|
|
|
@@ -1196,6 +1217,44 @@ interface PhantomLabels {
|
|
|
1196
1217
|
* Labels are expected to already be normalized via normalizeId (uppercase).
|
|
1197
1218
|
*/
|
|
1198
1219
|
declare function buildPhantomSuffix(phantoms: PhantomLabels): string;
|
|
1220
|
+
/**
|
|
1221
|
+
* The bytes to put BETWEEN a chunk's content and its phantom suffix so the
|
|
1222
|
+
* suffix's definition lines are parsed as definitions.
|
|
1223
|
+
*
|
|
1224
|
+
* `buildPhantomSuffix` is appended (never prepended: the incremental engine
|
|
1225
|
+
* treats the suffix as an always-tail input, and prepending would shift
|
|
1226
|
+
* every source position). But an append lands INSIDE whatever block the
|
|
1227
|
+
* content ends in — and a fenced code block or `$$` flow-math block that is
|
|
1228
|
+
* still open at the end of a streaming frame swallows everything up to EOF:
|
|
1229
|
+
* the sentinel lines render as code/math text and, since no definition was
|
|
1230
|
+
* registered, every cross-chunk reference in the chunk falls back to literal
|
|
1231
|
+
* `[text][label]` for the whole time the block streams (2026-08 project
|
|
1232
|
+
* review, core-render-01). Closing the block first is output-neutral: an
|
|
1233
|
+
* unclosed fence/math block already renders exactly the lines it has, so
|
|
1234
|
+
* `content + closer` yields the same code/math node value (positions
|
|
1235
|
+
* extend past `content.length`, which every consumer already tolerates for
|
|
1236
|
+
* the suffix's own nodes).
|
|
1237
|
+
*
|
|
1238
|
+
* The closer is emitted at the opener line's indent, which closes the block
|
|
1239
|
+
* both at top level (≤3 spaces are permitted there) and inside a list item
|
|
1240
|
+
* whose content indent the opener already satisfies (a column-0 closer
|
|
1241
|
+
* would END the item and open a NEW block that swallows the suffix — worse
|
|
1242
|
+
* than not closing).
|
|
1243
|
+
*
|
|
1244
|
+
* Only fences and flow math are closed. Raw-HTML constructs (`<!--`, `<?`,
|
|
1245
|
+
* `<![CDATA[`, `<!X`, `<script>`) that stay open to EOF also swallow the
|
|
1246
|
+
* suffix (invisibly — sanitize strips them), but their closers are not
|
|
1247
|
+
* position-neutral for the paragraph-inline forms and the shapes are rare
|
|
1248
|
+
* in LLM output; they keep the plain-append behaviour. When the scanner's
|
|
1249
|
+
* fence/math phase is untrusted (`phasePoisonedAt` — a suppressed open in a
|
|
1250
|
+
* container, see computeFreezeBoundary blocker 7) no closer is emitted
|
|
1251
|
+
* either: a wrong closer would OPEN a block around the suffix.
|
|
1252
|
+
*
|
|
1253
|
+
* Returns '' when nothing needs closing. Cost: one line scan of `content`
|
|
1254
|
+
* (regex per line; no reference tracking) — only paid by chunks that have a
|
|
1255
|
+
* non-empty phantom suffix.
|
|
1256
|
+
*/
|
|
1257
|
+
declare function phantomSuffixCloser(content: string): string;
|
|
1199
1258
|
|
|
1200
1259
|
/**
|
|
1201
1260
|
* Custom mdast-util-to-hast handlers for cross-chunk label resolution.
|
|
@@ -1343,19 +1402,6 @@ declare const defaultEnginePlugins: readonly AIMarkdownEnginePlugin[];
|
|
|
1343
1402
|
*/
|
|
1344
1403
|
declare function isFootnoteSection(node: Element): boolean;
|
|
1345
1404
|
|
|
1346
|
-
/**
|
|
1347
|
-
* CommonMark §4.7 label normalization. Used as the single canonical form
|
|
1348
|
-
* for all label-keyed structures (registry maps, phantomFootnoteLabels Set,
|
|
1349
|
-
* labelSet, etc.) and for handler comparisons against mdast-util-to-hast's
|
|
1350
|
-
* internal `state.definitionById` / `state.footnoteById` keys.
|
|
1351
|
-
*
|
|
1352
|
-
* Direction is uppercase to align with mdast-util-to-hast internals
|
|
1353
|
-
* (`String(identifier).toUpperCase()`). Direction is irrelevant once both
|
|
1354
|
-
* sides agree; uppercase chosen to match the upstream library to minimize
|
|
1355
|
-
* adapter calls.
|
|
1356
|
-
*
|
|
1357
|
-
* @module components/normalizeId
|
|
1358
|
-
*/
|
|
1359
1405
|
declare function normalizeId(s: string): string;
|
|
1360
1406
|
/**
|
|
1361
1407
|
* Same as {@link normalizeId} plus resolution of backslash escapes.
|
|
@@ -1692,7 +1738,13 @@ interface SmoothStreamController {
|
|
|
1692
1738
|
finish(): void;
|
|
1693
1739
|
/** Jumps to `source` instantly, no animation, and clears any backlog. */
|
|
1694
1740
|
snap(source: string): void;
|
|
1695
|
-
/**
|
|
1741
|
+
/**
|
|
1742
|
+
* Reveals everything pending right now (skip-animation affordance). Keeps
|
|
1743
|
+
* the grapheme discipline: while the stream is not finished, the trailing
|
|
1744
|
+
* grapheme of the source stays held back exactly as the animation would
|
|
1745
|
+
* hold it (a surrogate half or a growing ZWJ sequence must never reach
|
|
1746
|
+
* the parser); {@link finish} or the next {@link update} confirms it.
|
|
1747
|
+
*/
|
|
1696
1748
|
flush(): void;
|
|
1697
1749
|
/** Subscribes to visible-prefix changes. Returns the unsubscribe. */
|
|
1698
1750
|
subscribe(listener: () => void): () => void;
|
|
@@ -1899,4 +1951,4 @@ type RemendPreprocessorOptions = Omit<RemendOptions, 'katex' | 'inlineKatex'>;
|
|
|
1899
1951
|
*/
|
|
1900
1952
|
declare function createRemendPreprocessor(options?: RemendPreprocessorOptions): AIMDContentPreprocessor;
|
|
1901
1953
|
|
|
1902
|
-
export { type AIMDContentPreprocessor, type AIMarkdownEnginePlugin, type AIMarkdownEnginePluginName, type AdvanceOptions, type AdvanceResult, type AllowElement, type ChunkData, type Contribution, type CrossChunkHandlerOptions, DEFAULT_PAYLOAD, DEF_LINE_START_RE, type DefLabelScanner, type DefLabels, type Deprecation, type EnginePluginInternals, type EnginePluginStage, type ExtractContributionsOptions, type FootnoteDef, type FreezeBoundaryOptions, type IncrementalParseState, type IncrementalStage, type LinkDef, PIPELINE_STAGES, type ParsedMarkdown, type PhantomLabels, type PipelineOptions, type PipelineStage, type RefKind, type RefRecord, type Registry, type RegistryInternal, type RehypePlugins, type RehypeRebaseHashLinksOptions, type RemarkPlugins, type RemarkRehypeOptions, type RemendPreprocessorOptions, SENTINEL_FN_CONTENT, SENTINEL_LINK_URL, SMOOTH_STREAM_PACING_PRESETS, STAGE_MEASURE_PREFIX, type SanitizeSchema, type SmoothStreamController, type SmoothStreamOptions, type SmoothStreamPacing, type SmoothStreamPacingParams, type TransformContext, type UrlAttrKey, type UrlAttrTag, type UrlTransform, advanceIncrementalParse, attributeHastChildren, buildCoreRehypePlugins, buildCoreRemarkPlugins, buildCoreRemarkRehypeOptions, buildCrossChunkHandlers, buildPhantomSuffix, buildTransform, codePointSnapshots, collectDefLabels, computeFreezeBoundary, createDefLabelScanner, createFile, createIncrementalLatexPreprocessor, createProcessor, createRegistry, createRemendPreprocessor, createSmoothStreamController, defaultEnginePlugins, defaultUrlTransform, definitionList, extendSanitizeSchema, extractContributions, extractDefBodiesFromHast, getEnginePluginInternals, hasLoneSurrogate, highlight, isFootnoteSection, lastRegionStart, measureStage, mergeClassNameAllowlist, normalizeForMatch, normalizeId, pangu, parseStage, preprocessAIMDContent, preprocessLaTeX, rehypeFooterAdorn, rehypeRebaseHashLinks, removeComments, sanitizeCrossChunkUrl, sanitizeSchema, shortenDocumentId, smartypants, sourceIdFromFootnoteLiId, splitByProtectedRegions, subscribeStageTimings, transformStage, withDefs };
|
|
1954
|
+
export { type AIMDContentPreprocessor, type AIMarkdownEnginePlugin, type AIMarkdownEnginePluginName, type AdvanceOptions, type AdvanceResult, type AllowElement, type ChunkData, type Contribution, type CrossChunkHandlerOptions, DEFAULT_PAYLOAD, DEF_LINE_START_RE, type DefLabelScanner, type DefLabels, type Deprecation, type EnginePluginInternals, type EnginePluginStage, type ExtractContributionsOptions, type FootnoteDef, type FreezeBoundaryOptions, type IncrementalParseState, type IncrementalStage, type LinkDef, PIPELINE_STAGES, type ParsedMarkdown, type PhantomLabels, type PipelineOptions, type PipelineStage, type RefKind, type RefRecord, type Registry, type RegistryInternal, type RehypePlugins, type RehypeRebaseHashLinksOptions, type RemarkPlugins, type RemarkRehypeOptions, type RemendPreprocessorOptions, SENTINEL_FN_CONTENT, SENTINEL_LINK_URL, SMOOTH_STREAM_PACING_PRESETS, STAGE_MEASURE_PREFIX, type SanitizeSchema, type SmoothStreamController, type SmoothStreamOptions, type SmoothStreamPacing, type SmoothStreamPacingParams, type TransformContext, type UrlAttrKey, type UrlAttrTag, type UrlTransform, advanceIncrementalParse, attributeHastChildren, buildCoreRehypePlugins, buildCoreRemarkPlugins, buildCoreRemarkRehypeOptions, buildCrossChunkHandlers, buildPhantomSuffix, buildTransform, codePointSnapshots, collectDefLabels, computeFreezeBoundary, createDefLabelScanner, createFile, createIncrementalLatexPreprocessor, createProcessor, createRegistry, createRemendPreprocessor, createSmoothStreamController, defaultEnginePlugins, defaultUrlTransform, definitionList, extendSanitizeSchema, extractContributions, extractDefBodiesFromHast, getEnginePluginInternals, hasLoneSurrogate, highlight, isFootnoteSection, lastRegionStart, measureStage, mergeClassNameAllowlist, normalizeForMatch, normalizeId, pangu, parseStage, phantomSuffixCloser, preprocessAIMDContent, preprocessLaTeX, rehypeFooterAdorn, rehypeRebaseHashLinks, removeComments, sanitizeCrossChunkUrl, sanitizeSchema, shortenDocumentId, smartypants, sourceIdFromFootnoteLiId, splitByProtectedRegions, subscribeStageTimings, transformStage, withDefs };
|
package/dist/index.d.ts
CHANGED
|
@@ -184,7 +184,10 @@ declare const defaultUrlTransform: UrlTransform;
|
|
|
184
184
|
* tracked outside fences; while any tag, comment, or raw block
|
|
185
185
|
* (`<?…?>` / `<!DECL…>` / `<![CDATA[…]]>` — CommonMark html block types
|
|
186
186
|
* 3–5) is open, candidates are blocked. Line-truncated tag starts
|
|
187
|
-
* (`<div` at EOL, attributes wrapping) count as opens.
|
|
187
|
+
* (`<div` at EOL, attributes wrapping) count as opens. Closers that
|
|
188
|
+
* OVERLAP their opener (`<!-->`, `<!--->`, line-start `<?>`) close on
|
|
189
|
+
* the spot — CommonMark and parse5 agree — so the markup after them is
|
|
190
|
+
* scanned, not skipped as construct interior.
|
|
188
191
|
* 2. **`$$` flow math** — remark-math's flow math swallows blank lines and
|
|
189
192
|
* runs to EOF when unclosed (verified empirically); its closing fence
|
|
190
193
|
* must sit at LINE START (a mid-line `$$` does not close it). Math
|
|
@@ -218,16 +221,24 @@ declare const defaultUrlTransform: UrlTransform;
|
|
|
218
221
|
* reproduced on v1.8.0). The candidate adjacent to such a run is
|
|
219
222
|
* rejected until a later confirmed content line pins the seam from the
|
|
220
223
|
* frozen side; dropping candidates only over-blocks (safe direction).
|
|
224
|
+
* A type 2-5 block that opens AND closes on its first line owns the
|
|
225
|
+
* rest of that line as raw content too (`<!-- c --> tail`) — same seam.
|
|
221
226
|
* 7. **Phase poison** (`phasePoisonedAt`) — points where this line-level
|
|
222
227
|
* model may have DIVERGED from micromark and provably cannot resync:
|
|
223
228
|
* a fence/math open suppressed by `htmlFlowSinceBlank` (only certainly
|
|
224
229
|
* swallowed at top level — in a container it really opens and the
|
|
225
230
|
* open/close phase inverts permanently), and a paragraph-inline `<!--`
|
|
226
231
|
* that fails to close by end of line (literal text to micromark, but
|
|
227
|
-
* the comment scan would skip real markup as comment interior)
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
232
|
+
* the comment scan would skip real markup as comment interior), and
|
|
233
|
+
* every point where CommonMark's terminator and parse5's tokenizer
|
|
234
|
+
* DISAGREE about where a raw construct ends (`--!>` closes a comment
|
|
235
|
+
* for parse5 only; a `<?…`/`<![CDATA[…` bogus comment ends at its
|
|
236
|
+
* first `>` for parse5 but at `?>`/`]]>` for CommonMark; a paragraph-
|
|
237
|
+
* inline `<?>` is open to micromark, closed to parse5) — the bytes in
|
|
238
|
+
* between are raw text to one grammar and real markup to the other, and
|
|
239
|
+
* the hast is parse5's. Every candidate past the first such point is
|
|
240
|
+
* rejected, sticky; candidates at or before it stay valid — the
|
|
241
|
+
* ambiguous region then re-parses inside the tail (pure over-block).
|
|
231
242
|
*
|
|
232
243
|
* ## Incremental scanning (checkpoint resume)
|
|
233
244
|
*
|
|
@@ -353,6 +364,12 @@ interface FreezeScanCheckpoint {
|
|
|
353
364
|
inMath: boolean;
|
|
354
365
|
/** Opening dollar-run length while inMath — the close run must match it. */
|
|
355
366
|
mathFenceLen: number;
|
|
367
|
+
/** Indent (0-3 spaces) of the line that opened the current fence/math
|
|
368
|
+
* block. Not a blocker input — read by `phantomSuffixCloser` to emit a
|
|
369
|
+
* closer at the SAME indent, which closes the block whether it sits at
|
|
370
|
+
* top level (≤3 spaces are allowed there) or inside a list item whose
|
|
371
|
+
* content indent the opener line already satisfies. */
|
|
372
|
+
openIndent: number;
|
|
356
373
|
blankRun: number;
|
|
357
374
|
lastBlankStart: number;
|
|
358
375
|
/** Rolling blocker-3 verdict ("nearest decisive block start so far"). */
|
|
@@ -392,6 +409,10 @@ interface FreezeScanCheckpoint {
|
|
|
392
409
|
* ambiguous tag names stays, but it decays at the next decisive block
|
|
393
410
|
* start — this field is the phase-corruption backstop that does not. */
|
|
394
411
|
phasePoisonedAt: number;
|
|
412
|
+
/** Tag names of line-truncated opens (`<div` at EOL) counted into
|
|
413
|
+
* tagBalance but not yet confirmed by a later `>` — reverted at the next
|
|
414
|
+
* blank line (a tag cannot span one). See TRUNCATED_TAG_RE. */
|
|
415
|
+
pendingTruncatedTags: string[];
|
|
395
416
|
}
|
|
396
417
|
declare function computeFreezeBoundary(text: string, options: FreezeBoundaryOptions, resume?: FreezeScanCheckpoint | null): FreezeScanResult;
|
|
397
418
|
|
|
@@ -1196,6 +1217,44 @@ interface PhantomLabels {
|
|
|
1196
1217
|
* Labels are expected to already be normalized via normalizeId (uppercase).
|
|
1197
1218
|
*/
|
|
1198
1219
|
declare function buildPhantomSuffix(phantoms: PhantomLabels): string;
|
|
1220
|
+
/**
|
|
1221
|
+
* The bytes to put BETWEEN a chunk's content and its phantom suffix so the
|
|
1222
|
+
* suffix's definition lines are parsed as definitions.
|
|
1223
|
+
*
|
|
1224
|
+
* `buildPhantomSuffix` is appended (never prepended: the incremental engine
|
|
1225
|
+
* treats the suffix as an always-tail input, and prepending would shift
|
|
1226
|
+
* every source position). But an append lands INSIDE whatever block the
|
|
1227
|
+
* content ends in — and a fenced code block or `$$` flow-math block that is
|
|
1228
|
+
* still open at the end of a streaming frame swallows everything up to EOF:
|
|
1229
|
+
* the sentinel lines render as code/math text and, since no definition was
|
|
1230
|
+
* registered, every cross-chunk reference in the chunk falls back to literal
|
|
1231
|
+
* `[text][label]` for the whole time the block streams (2026-08 project
|
|
1232
|
+
* review, core-render-01). Closing the block first is output-neutral: an
|
|
1233
|
+
* unclosed fence/math block already renders exactly the lines it has, so
|
|
1234
|
+
* `content + closer` yields the same code/math node value (positions
|
|
1235
|
+
* extend past `content.length`, which every consumer already tolerates for
|
|
1236
|
+
* the suffix's own nodes).
|
|
1237
|
+
*
|
|
1238
|
+
* The closer is emitted at the opener line's indent, which closes the block
|
|
1239
|
+
* both at top level (≤3 spaces are permitted there) and inside a list item
|
|
1240
|
+
* whose content indent the opener already satisfies (a column-0 closer
|
|
1241
|
+
* would END the item and open a NEW block that swallows the suffix — worse
|
|
1242
|
+
* than not closing).
|
|
1243
|
+
*
|
|
1244
|
+
* Only fences and flow math are closed. Raw-HTML constructs (`<!--`, `<?`,
|
|
1245
|
+
* `<![CDATA[`, `<!X`, `<script>`) that stay open to EOF also swallow the
|
|
1246
|
+
* suffix (invisibly — sanitize strips them), but their closers are not
|
|
1247
|
+
* position-neutral for the paragraph-inline forms and the shapes are rare
|
|
1248
|
+
* in LLM output; they keep the plain-append behaviour. When the scanner's
|
|
1249
|
+
* fence/math phase is untrusted (`phasePoisonedAt` — a suppressed open in a
|
|
1250
|
+
* container, see computeFreezeBoundary blocker 7) no closer is emitted
|
|
1251
|
+
* either: a wrong closer would OPEN a block around the suffix.
|
|
1252
|
+
*
|
|
1253
|
+
* Returns '' when nothing needs closing. Cost: one line scan of `content`
|
|
1254
|
+
* (regex per line; no reference tracking) — only paid by chunks that have a
|
|
1255
|
+
* non-empty phantom suffix.
|
|
1256
|
+
*/
|
|
1257
|
+
declare function phantomSuffixCloser(content: string): string;
|
|
1199
1258
|
|
|
1200
1259
|
/**
|
|
1201
1260
|
* Custom mdast-util-to-hast handlers for cross-chunk label resolution.
|
|
@@ -1343,19 +1402,6 @@ declare const defaultEnginePlugins: readonly AIMarkdownEnginePlugin[];
|
|
|
1343
1402
|
*/
|
|
1344
1403
|
declare function isFootnoteSection(node: Element): boolean;
|
|
1345
1404
|
|
|
1346
|
-
/**
|
|
1347
|
-
* CommonMark §4.7 label normalization. Used as the single canonical form
|
|
1348
|
-
* for all label-keyed structures (registry maps, phantomFootnoteLabels Set,
|
|
1349
|
-
* labelSet, etc.) and for handler comparisons against mdast-util-to-hast's
|
|
1350
|
-
* internal `state.definitionById` / `state.footnoteById` keys.
|
|
1351
|
-
*
|
|
1352
|
-
* Direction is uppercase to align with mdast-util-to-hast internals
|
|
1353
|
-
* (`String(identifier).toUpperCase()`). Direction is irrelevant once both
|
|
1354
|
-
* sides agree; uppercase chosen to match the upstream library to minimize
|
|
1355
|
-
* adapter calls.
|
|
1356
|
-
*
|
|
1357
|
-
* @module components/normalizeId
|
|
1358
|
-
*/
|
|
1359
1405
|
declare function normalizeId(s: string): string;
|
|
1360
1406
|
/**
|
|
1361
1407
|
* Same as {@link normalizeId} plus resolution of backslash escapes.
|
|
@@ -1692,7 +1738,13 @@ interface SmoothStreamController {
|
|
|
1692
1738
|
finish(): void;
|
|
1693
1739
|
/** Jumps to `source` instantly, no animation, and clears any backlog. */
|
|
1694
1740
|
snap(source: string): void;
|
|
1695
|
-
/**
|
|
1741
|
+
/**
|
|
1742
|
+
* Reveals everything pending right now (skip-animation affordance). Keeps
|
|
1743
|
+
* the grapheme discipline: while the stream is not finished, the trailing
|
|
1744
|
+
* grapheme of the source stays held back exactly as the animation would
|
|
1745
|
+
* hold it (a surrogate half or a growing ZWJ sequence must never reach
|
|
1746
|
+
* the parser); {@link finish} or the next {@link update} confirms it.
|
|
1747
|
+
*/
|
|
1696
1748
|
flush(): void;
|
|
1697
1749
|
/** Subscribes to visible-prefix changes. Returns the unsubscribe. */
|
|
1698
1750
|
subscribe(listener: () => void): () => void;
|
|
@@ -1899,4 +1951,4 @@ type RemendPreprocessorOptions = Omit<RemendOptions, 'katex' | 'inlineKatex'>;
|
|
|
1899
1951
|
*/
|
|
1900
1952
|
declare function createRemendPreprocessor(options?: RemendPreprocessorOptions): AIMDContentPreprocessor;
|
|
1901
1953
|
|
|
1902
|
-
export { type AIMDContentPreprocessor, type AIMarkdownEnginePlugin, type AIMarkdownEnginePluginName, type AdvanceOptions, type AdvanceResult, type AllowElement, type ChunkData, type Contribution, type CrossChunkHandlerOptions, DEFAULT_PAYLOAD, DEF_LINE_START_RE, type DefLabelScanner, type DefLabels, type Deprecation, type EnginePluginInternals, type EnginePluginStage, type ExtractContributionsOptions, type FootnoteDef, type FreezeBoundaryOptions, type IncrementalParseState, type IncrementalStage, type LinkDef, PIPELINE_STAGES, type ParsedMarkdown, type PhantomLabels, type PipelineOptions, type PipelineStage, type RefKind, type RefRecord, type Registry, type RegistryInternal, type RehypePlugins, type RehypeRebaseHashLinksOptions, type RemarkPlugins, type RemarkRehypeOptions, type RemendPreprocessorOptions, SENTINEL_FN_CONTENT, SENTINEL_LINK_URL, SMOOTH_STREAM_PACING_PRESETS, STAGE_MEASURE_PREFIX, type SanitizeSchema, type SmoothStreamController, type SmoothStreamOptions, type SmoothStreamPacing, type SmoothStreamPacingParams, type TransformContext, type UrlAttrKey, type UrlAttrTag, type UrlTransform, advanceIncrementalParse, attributeHastChildren, buildCoreRehypePlugins, buildCoreRemarkPlugins, buildCoreRemarkRehypeOptions, buildCrossChunkHandlers, buildPhantomSuffix, buildTransform, codePointSnapshots, collectDefLabels, computeFreezeBoundary, createDefLabelScanner, createFile, createIncrementalLatexPreprocessor, createProcessor, createRegistry, createRemendPreprocessor, createSmoothStreamController, defaultEnginePlugins, defaultUrlTransform, definitionList, extendSanitizeSchema, extractContributions, extractDefBodiesFromHast, getEnginePluginInternals, hasLoneSurrogate, highlight, isFootnoteSection, lastRegionStart, measureStage, mergeClassNameAllowlist, normalizeForMatch, normalizeId, pangu, parseStage, preprocessAIMDContent, preprocessLaTeX, rehypeFooterAdorn, rehypeRebaseHashLinks, removeComments, sanitizeCrossChunkUrl, sanitizeSchema, shortenDocumentId, smartypants, sourceIdFromFootnoteLiId, splitByProtectedRegions, subscribeStageTimings, transformStage, withDefs };
|
|
1954
|
+
export { type AIMDContentPreprocessor, type AIMarkdownEnginePlugin, type AIMarkdownEnginePluginName, type AdvanceOptions, type AdvanceResult, type AllowElement, type ChunkData, type Contribution, type CrossChunkHandlerOptions, DEFAULT_PAYLOAD, DEF_LINE_START_RE, type DefLabelScanner, type DefLabels, type Deprecation, type EnginePluginInternals, type EnginePluginStage, type ExtractContributionsOptions, type FootnoteDef, type FreezeBoundaryOptions, type IncrementalParseState, type IncrementalStage, type LinkDef, PIPELINE_STAGES, type ParsedMarkdown, type PhantomLabels, type PipelineOptions, type PipelineStage, type RefKind, type RefRecord, type Registry, type RegistryInternal, type RehypePlugins, type RehypeRebaseHashLinksOptions, type RemarkPlugins, type RemarkRehypeOptions, type RemendPreprocessorOptions, SENTINEL_FN_CONTENT, SENTINEL_LINK_URL, SMOOTH_STREAM_PACING_PRESETS, STAGE_MEASURE_PREFIX, type SanitizeSchema, type SmoothStreamController, type SmoothStreamOptions, type SmoothStreamPacing, type SmoothStreamPacingParams, type TransformContext, type UrlAttrKey, type UrlAttrTag, type UrlTransform, advanceIncrementalParse, attributeHastChildren, buildCoreRehypePlugins, buildCoreRemarkPlugins, buildCoreRemarkRehypeOptions, buildCrossChunkHandlers, buildPhantomSuffix, buildTransform, codePointSnapshots, collectDefLabels, computeFreezeBoundary, createDefLabelScanner, createFile, createIncrementalLatexPreprocessor, createProcessor, createRegistry, createRemendPreprocessor, createSmoothStreamController, defaultEnginePlugins, defaultUrlTransform, definitionList, extendSanitizeSchema, extractContributions, extractDefBodiesFromHast, getEnginePluginInternals, hasLoneSurrogate, highlight, isFootnoteSection, lastRegionStart, measureStage, mergeClassNameAllowlist, normalizeForMatch, normalizeId, pangu, parseStage, phantomSuffixCloser, preprocessAIMDContent, preprocessLaTeX, rehypeFooterAdorn, rehypeRebaseHashLinks, removeComments, sanitizeCrossChunkUrl, sanitizeSchema, shortenDocumentId, smartypants, sourceIdFromFootnoteLiId, splitByProtectedRegions, subscribeStageTimings, transformStage, withDefs };
|