@ai-react-markdown/engine 2.10.0 → 2.10.1
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 +13 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.dev.cjs +13 -1
- package/dist/index.dev.cjs.map +1 -1
- package/dist/index.dev.js +13 -1
- package/dist/index.dev.js.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.dev.cjs
CHANGED
|
@@ -5007,8 +5007,20 @@ function escapeLatexPipesInUnclosed(text) {
|
|
|
5007
5007
|
const tail = text.substring(unclosedStart + delimLen);
|
|
5008
5008
|
return before + delim + replaceUnescapedPipes(tail);
|
|
5009
5009
|
}
|
|
5010
|
+
function opensMathFlow(text, pos) {
|
|
5011
|
+
let i = pos;
|
|
5012
|
+
let spaces = 0;
|
|
5013
|
+
while (i > 0 && text[i - 1] !== "\n") {
|
|
5014
|
+
i -= 1;
|
|
5015
|
+
if (text[i] !== " ") return false;
|
|
5016
|
+
spaces += 1;
|
|
5017
|
+
if (spaces > 3) return false;
|
|
5018
|
+
}
|
|
5019
|
+
return true;
|
|
5020
|
+
}
|
|
5010
5021
|
function truncateUnclosedLatexBlock(text, unclosedStart = findUnclosedDelimiterStart(text, "double-only")) {
|
|
5011
5022
|
if (unclosedStart === -1) return text;
|
|
5023
|
+
if (!opensMathFlow(text, unclosedStart)) return text;
|
|
5012
5024
|
return text.substring(0, unclosedStart).trimEnd();
|
|
5013
5025
|
}
|
|
5014
5026
|
function escapeTextUnderscores(text) {
|
|
@@ -5109,7 +5121,7 @@ function processSlice(slice, probe = true) {
|
|
|
5109
5121
|
unclosedDouble = findUnclosedDelimiterStart(text, "double-only");
|
|
5110
5122
|
if (unclosedDouble !== -1) {
|
|
5111
5123
|
quiescent = false;
|
|
5112
|
-
if (index === 0 && text.slice(0, unclosedDouble).trim() === "") {
|
|
5124
|
+
if (index === 0 && opensMathFlow(text, unclosedDouble) && text.slice(0, unclosedDouble).trim() === "") {
|
|
5113
5125
|
truncatedAtSeamStart = true;
|
|
5114
5126
|
}
|
|
5115
5127
|
}
|