@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.cjs
CHANGED
|
@@ -651,7 +651,8 @@ function classifyBlockStart(text, indent, defListEnabled) {
|
|
|
651
651
|
function computeFreezeBoundary(text, options, resume) {
|
|
652
652
|
const mathFlow = options.mathFlow ?? true;
|
|
653
653
|
const referenceTaint = options.referenceTaint ?? true;
|
|
654
|
-
const
|
|
654
|
+
const prev = resume;
|
|
655
|
+
const cp = prev && prev.defListEnabled === options.defListEnabled && prev.mathFlow === mathFlow && prev.referenceTaint === referenceTaint && prev.confirmedOffset <= text.length ? prev : freshCheckpoint(options.defListEnabled, mathFlow, referenceTaint);
|
|
655
656
|
let start = cp.confirmedOffset;
|
|
656
657
|
let tailLine = null;
|
|
657
658
|
while (start < text.length) {
|
|
@@ -714,6 +715,14 @@ function computeFreezeBoundary(text, options, resume) {
|
|
|
714
715
|
}
|
|
715
716
|
return { boundary, checkpoint: cp };
|
|
716
717
|
}
|
|
718
|
+
function pendingFenceCloser(checkpoint) {
|
|
719
|
+
const cp = checkpoint;
|
|
720
|
+
if (cp.phasePoisonedAt !== Infinity) return "";
|
|
721
|
+
if (cp.openIndent !== 0) return "";
|
|
722
|
+
if (cp.inFence) return cp.fenceChar.repeat(cp.fenceLen);
|
|
723
|
+
if (cp.inMath) return "$".repeat(cp.mathFenceLen);
|
|
724
|
+
return "";
|
|
725
|
+
}
|
|
717
726
|
function floatingResidue(text, commentOpenAtStart) {
|
|
718
727
|
let out = "";
|
|
719
728
|
let open = commentOpenAtStart;
|
|
@@ -2265,12 +2274,10 @@ function phantomSuffixCloser(content) {
|
|
|
2265
2274
|
const endsWithNewline = content.endsWith("\n");
|
|
2266
2275
|
const confirmed = endsWithNewline ? content : content + "\n";
|
|
2267
2276
|
const { checkpoint } = computeFreezeBoundary(confirmed, { defListEnabled: false, referenceTaint: false });
|
|
2268
|
-
|
|
2269
|
-
if (
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
if (checkpoint.inMath) return `${nl}${"$".repeat(checkpoint.mathFenceLen)}`;
|
|
2273
|
-
return "";
|
|
2277
|
+
const closer = pendingFenceCloser(checkpoint);
|
|
2278
|
+
if (closer === "") return "";
|
|
2279
|
+
return endsWithNewline ? closer : `
|
|
2280
|
+
${closer}`;
|
|
2274
2281
|
}
|
|
2275
2282
|
|
|
2276
2283
|
// src/components/extractContributions.ts
|