@ai-react-markdown/engine 2.5.5 → 2.6.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 +14 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -199
- package/dist/index.d.ts +7 -199
- package/dist/index.dev.cjs +14 -7
- package/dist/index.dev.cjs.map +1 -1
- package/dist/index.dev.js +14 -7
- package/dist/index.dev.js.map +1 -1
- package/dist/index.js +14 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -558,7 +558,8 @@ function classifyBlockStart(text, indent, defListEnabled) {
|
|
|
558
558
|
function computeFreezeBoundary(text, options, resume) {
|
|
559
559
|
const mathFlow = options.mathFlow ?? true;
|
|
560
560
|
const referenceTaint = options.referenceTaint ?? true;
|
|
561
|
-
const
|
|
561
|
+
const prev = resume;
|
|
562
|
+
const cp = prev && prev.defListEnabled === options.defListEnabled && prev.mathFlow === mathFlow && prev.referenceTaint === referenceTaint && prev.confirmedOffset <= text.length ? prev : freshCheckpoint(options.defListEnabled, mathFlow, referenceTaint);
|
|
562
563
|
let start = cp.confirmedOffset;
|
|
563
564
|
let tailLine = null;
|
|
564
565
|
while (start < text.length) {
|
|
@@ -621,6 +622,14 @@ function computeFreezeBoundary(text, options, resume) {
|
|
|
621
622
|
}
|
|
622
623
|
return { boundary, checkpoint: cp };
|
|
623
624
|
}
|
|
625
|
+
function pendingFenceCloser(checkpoint) {
|
|
626
|
+
const cp = checkpoint;
|
|
627
|
+
if (cp.phasePoisonedAt !== Infinity) return "";
|
|
628
|
+
if (cp.openIndent !== 0) return "";
|
|
629
|
+
if (cp.inFence) return cp.fenceChar.repeat(cp.fenceLen);
|
|
630
|
+
if (cp.inMath) return "$".repeat(cp.mathFenceLen);
|
|
631
|
+
return "";
|
|
632
|
+
}
|
|
624
633
|
function floatingResidue(text, commentOpenAtStart) {
|
|
625
634
|
let out = "";
|
|
626
635
|
let open = commentOpenAtStart;
|
|
@@ -2172,12 +2181,10 @@ function phantomSuffixCloser(content) {
|
|
|
2172
2181
|
const endsWithNewline = content.endsWith("\n");
|
|
2173
2182
|
const confirmed = endsWithNewline ? content : content + "\n";
|
|
2174
2183
|
const { checkpoint } = computeFreezeBoundary(confirmed, { defListEnabled: false, referenceTaint: false });
|
|
2175
|
-
|
|
2176
|
-
if (
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
if (checkpoint.inMath) return `${nl}${"$".repeat(checkpoint.mathFenceLen)}`;
|
|
2180
|
-
return "";
|
|
2184
|
+
const closer = pendingFenceCloser(checkpoint);
|
|
2185
|
+
if (closer === "") return "";
|
|
2186
|
+
return endsWithNewline ? closer : `
|
|
2187
|
+
${closer}`;
|
|
2181
2188
|
}
|
|
2182
2189
|
|
|
2183
2190
|
// src/components/extractContributions.ts
|