@ai-react-markdown/engine 2.9.0 → 2.9.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 +27 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.dev.cjs +29 -14
- package/dist/index.dev.cjs.map +1 -1
- package/dist/index.dev.js +29 -14
- package/dist/index.dev.js.map +1 -1
- package/dist/index.js +27 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.dev.js
CHANGED
|
@@ -370,16 +370,15 @@ function settleRefsAndEarliestUnresolved(cp) {
|
|
|
370
370
|
var TYPE6_NAMES = new Set(htmlBlockNames);
|
|
371
371
|
var TABLE_PART_NAMES = /* @__PURE__ */ new Set(["td", "th", "tr", "tbody", "thead", "tfoot", "caption", "col", "colgroup"]);
|
|
372
372
|
var DOCUMENT_STRUCTURE_NAMES = /* @__PURE__ */ new Set(["html", "head", "body", "frameset"]);
|
|
373
|
+
var NO_ELEMENT_NAMES = /* @__PURE__ */ new Set([...DOCUMENT_STRUCTURE_NAMES, "frame", "image"]);
|
|
373
374
|
var RETROACTIVE_OPENERS = [
|
|
374
375
|
"<!doctype",
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
"</body",
|
|
382
|
-
"</frameset"
|
|
376
|
+
// DERIVED, so the trailing-partial guard cannot drift from the poison the
|
|
377
|
+
// confirmed lines get. It was transcribed until F28, and the transcription
|
|
378
|
+
// was already two names behind by then. `<frame` subsumes `<frameset`,
|
|
379
|
+
// which is why the derived list is SHORTER than the one it replaces and
|
|
380
|
+
// still covers strictly more.
|
|
381
|
+
...[...NO_ELEMENT_NAMES].flatMap((name) => [`<${name}`, `</${name}`])
|
|
383
382
|
];
|
|
384
383
|
function tailCarriesRetroactive(text) {
|
|
385
384
|
const lower = text.toLowerCase();
|
|
@@ -632,6 +631,7 @@ function freshCheckpoint(defListEnabled, mathFlow, referenceTaint) {
|
|
|
632
631
|
tagBalance: /* @__PURE__ */ new Map(),
|
|
633
632
|
openTotal: 0,
|
|
634
633
|
p5Tok: { kind: "data" },
|
|
634
|
+
formPointerMaybeSet: false,
|
|
635
635
|
openStack: [],
|
|
636
636
|
mdBlock: { kind: "none" },
|
|
637
637
|
blankRun: 0,
|
|
@@ -782,6 +782,7 @@ function sealReleaseDerived(cp, ln, isBlockStart) {
|
|
|
782
782
|
if (DEF_RE.test(ln.text) || FOOTNOTE_DEF_RE.test(ln.text)) return false;
|
|
783
783
|
return true;
|
|
784
784
|
}
|
|
785
|
+
var sealReleaseEvaluations = 0;
|
|
785
786
|
function sealReleaseEnumerated(cp, ln, isBlockStart) {
|
|
786
787
|
const defShapedLine = DEF_RE.test(ln.text) || FOOTNOTE_DEF_RE.test(ln.text) || cp.defBlockMaybeOpen || cp.fnDefResumable && !(isBlockStart && ln.indent <= 3);
|
|
787
788
|
const commentOnly = ln.text.replace(/<!--[\s\S]*?-->/g, " ").replace(/<!--[\s\S]*$/, " ").replace(/[ \t\r]/g, "") === "";
|
|
@@ -796,10 +797,13 @@ function processConfirmedLine(cp, ln, text) {
|
|
|
796
797
|
if (cp.p5SealPending && !ln.blank && cp.mdBlock.kind !== "html" && !(cp.p5Tok.kind === "comment" || cp.p5Tok.kind === "bogus")) {
|
|
797
798
|
if (sealReleaseDerived(cp, ln, isBlockStart)) {
|
|
798
799
|
cp.p5SealPending = false;
|
|
799
|
-
if (
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
800
|
+
if (true) {
|
|
801
|
+
sealReleaseEvaluations += 1;
|
|
802
|
+
if (!sealReleaseEnumerated(cp, ln, isBlockStart)) {
|
|
803
|
+
console.error(
|
|
804
|
+
`[ai-react-markdown] seal-release containment broken at offset ${ln.start}: the derived predicate released a line the retired enumeration withheld (${JSON.stringify(ln.text.slice(0, 80))}).`
|
|
805
|
+
);
|
|
806
|
+
}
|
|
803
807
|
}
|
|
804
808
|
}
|
|
805
809
|
}
|
|
@@ -828,7 +832,7 @@ function processConfirmedLine(cp, ln, text) {
|
|
|
828
832
|
if (tag === "plaintext") cp.phasePoisonedAt = Math.min(cp.phasePoisonedAt, ln.start);
|
|
829
833
|
}
|
|
830
834
|
}
|
|
831
|
-
if (
|
|
835
|
+
if (NO_ELEMENT_NAMES.has(tag)) cp.phasePoisonedAt = 0;
|
|
832
836
|
if (tag === "template" && !closing) cp.phasePoisonedAt = 0;
|
|
833
837
|
if (closing) {
|
|
834
838
|
let idx = -1;
|
|
@@ -844,12 +848,14 @@ function processConfirmedLine(cp, ln, text) {
|
|
|
844
848
|
return;
|
|
845
849
|
}
|
|
846
850
|
cp.openStack.splice(idx, 1);
|
|
851
|
+
if (tag === "form") cp.formPointerMaybeSet = false;
|
|
847
852
|
const count = cp.tagBalance.get(tag) ?? 0;
|
|
848
853
|
if (count > 0) {
|
|
849
854
|
cp.tagBalance.set(tag, count - 1);
|
|
850
855
|
cp.openTotal -= 1;
|
|
851
856
|
}
|
|
852
857
|
} else {
|
|
858
|
+
if (tag === "form") cp.formPointerMaybeSet = true;
|
|
853
859
|
cp.openStack.push(tag);
|
|
854
860
|
cp.tagBalance.set(tag, (cp.tagBalance.get(tag) ?? 0) + 1);
|
|
855
861
|
cp.openTotal += 1;
|
|
@@ -976,7 +982,11 @@ function processConfirmedLine(cp, ln, text) {
|
|
|
976
982
|
// mask suppresses them — which is exactly why `openTotal` reads 0
|
|
977
983
|
// and the candidate looked safe), and the 2-5 interiors are the
|
|
978
984
|
// same construct to both grammars.
|
|
979
|
-
htmlBalanced: cp.openTotal === 0 && cp.mdBlock.kind !== "html" && cp.p5Tok.kind !== "bogus"
|
|
985
|
+
htmlBalanced: cp.openTotal === 0 && cp.mdBlock.kind !== "html" && cp.p5Tok.kind !== "bogus" && // A form pointer parse5 may still be holding makes a LATER `<form>`
|
|
986
|
+
// in the tail vanish from the full parse while a split parse opens
|
|
987
|
+
// it — forward independence fails with every other condition clean.
|
|
988
|
+
// See the field doc.
|
|
989
|
+
!cp.formPointerMaybeSet,
|
|
980
990
|
hazard: cp.hazardVerdict,
|
|
981
991
|
seamRisk: cp.p5SealPending,
|
|
982
992
|
defListSettled: null
|
|
@@ -1372,6 +1382,11 @@ var SCANNER_NAME_LISTS = [
|
|
|
1372
1382
|
["type6", TYPE6_NAMES],
|
|
1373
1383
|
["void", VOID_TAGS],
|
|
1374
1384
|
["documentStructure", DOCUMENT_STRUCTURE_NAMES],
|
|
1385
|
+
// Added with F28, and it is the list that would have made F28 visible: the
|
|
1386
|
+
// derived census alphabet partitions names by their membership across THIS
|
|
1387
|
+
// table, so before it existed `frame` shared one 39-name class with `div`
|
|
1388
|
+
// and could never be sampled apart from it.
|
|
1389
|
+
["noElement", NO_ELEMENT_NAMES],
|
|
1375
1390
|
["tablePart", TABLE_PART_NAMES],
|
|
1376
1391
|
["scopeBarrier", SCOPE_BARRIER_NAMES],
|
|
1377
1392
|
["foreignRoot", new Set(FOREIGN_ROOT_NAMES)]
|