@jxsuite/parser 4.1.0 → 4.1.2
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/content-loader.js +75 -29
- package/dist/markdown.js +75 -29
- package/dist/serialize.js +75 -29
- package/package.json +5 -5
package/dist/content-loader.js
CHANGED
|
@@ -18643,16 +18643,43 @@ function color2(d) {
|
|
|
18643
18643
|
}
|
|
18644
18644
|
|
|
18645
18645
|
// ../../node_modules/unist-util-visit/node_modules/unist-util-visit-parents/lib/index.js
|
|
18646
|
-
function visitParents2(tree,
|
|
18646
|
+
function visitParents2(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, reverse) {
|
|
18647
|
+
if (!tree || typeof tree !== "object") {
|
|
18648
|
+
throw new Error("Unexpected value `" + tree + "` for `tree`, expected node");
|
|
18649
|
+
}
|
|
18650
|
+
let preorder = true;
|
|
18647
18651
|
let check;
|
|
18648
|
-
|
|
18649
|
-
|
|
18650
|
-
|
|
18652
|
+
let visitors;
|
|
18653
|
+
let enter;
|
|
18654
|
+
let exit;
|
|
18655
|
+
if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
|
|
18656
|
+
check = testOrEnterOrVisitors;
|
|
18657
|
+
visitors = enterOrVisitorsOrReverse;
|
|
18658
|
+
if (reverse)
|
|
18659
|
+
preorder = false;
|
|
18651
18660
|
} else {
|
|
18652
|
-
|
|
18661
|
+
visitors = testOrEnterOrVisitors;
|
|
18662
|
+
if (enterOrVisitorsOrReverse)
|
|
18663
|
+
preorder = false;
|
|
18664
|
+
}
|
|
18665
|
+
if (typeof visitors === "function") {
|
|
18666
|
+
enter = visitors;
|
|
18667
|
+
} else if (visitors && typeof visitors === "object") {
|
|
18668
|
+
if (visitors.enter === null || visitors.enter === undefined) {} else if (typeof visitors.enter === "function") {
|
|
18669
|
+
enter = visitors.enter;
|
|
18670
|
+
} else {
|
|
18671
|
+
throw new Error("Unexpected value `" + visitors.enter + "` for `visitors.enter`, expected optional visitor");
|
|
18672
|
+
}
|
|
18673
|
+
if (typeof visitors.exit === "function") {
|
|
18674
|
+
exit = visitors.exit;
|
|
18675
|
+
} else {
|
|
18676
|
+
throw new Error("Unexpected value `" + visitors.exit + "` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)");
|
|
18677
|
+
}
|
|
18678
|
+
} else {
|
|
18679
|
+
throw new Error("Unexpected value `" + visitors + "` for `enter` or `visitors`, expected visitor or object with visitors");
|
|
18653
18680
|
}
|
|
18654
18681
|
const is = convert(check);
|
|
18655
|
-
const step =
|
|
18682
|
+
const step = preorder ? 1 : -1;
|
|
18656
18683
|
factory(tree, undefined, [])();
|
|
18657
18684
|
function factory(node, index, parents) {
|
|
18658
18685
|
const value = node && typeof node === "object" ? node : {};
|
|
@@ -18664,12 +18691,10 @@ function visitParents2(tree, test, visitor, reverse) {
|
|
|
18664
18691
|
}
|
|
18665
18692
|
return visit;
|
|
18666
18693
|
function visit() {
|
|
18694
|
+
const matches = !check || is(node, index, parents[parents.length - 1] || undefined);
|
|
18667
18695
|
let result = empty2;
|
|
18668
|
-
|
|
18669
|
-
|
|
18670
|
-
let grandparents;
|
|
18671
|
-
if (!test || is(node, index, parents[parents.length - 1] || undefined)) {
|
|
18672
|
-
result = toResult2(visitor(node, parents));
|
|
18696
|
+
if (enter && matches) {
|
|
18697
|
+
result = toResult2(enter(node, parents, index));
|
|
18673
18698
|
if (result[0] === EXIT2) {
|
|
18674
18699
|
return result;
|
|
18675
18700
|
}
|
|
@@ -18677,11 +18702,11 @@ function visitParents2(tree, test, visitor, reverse) {
|
|
|
18677
18702
|
if ("children" in node && node.children) {
|
|
18678
18703
|
const nodeAsParent = node;
|
|
18679
18704
|
if (nodeAsParent.children && result[0] !== SKIP2) {
|
|
18680
|
-
offset = (
|
|
18681
|
-
grandparents = parents
|
|
18705
|
+
let offset = (preorder ? -1 : nodeAsParent.children.length) + step;
|
|
18706
|
+
const grandparents = [...parents, nodeAsParent];
|
|
18682
18707
|
while (offset > -1 && offset < nodeAsParent.children.length) {
|
|
18683
18708
|
const child = nodeAsParent.children[offset];
|
|
18684
|
-
subresult = factory(child, offset, grandparents)();
|
|
18709
|
+
const subresult = factory(child, offset, grandparents)();
|
|
18685
18710
|
if (subresult[0] === EXIT2) {
|
|
18686
18711
|
return subresult;
|
|
18687
18712
|
}
|
|
@@ -18689,6 +18714,15 @@ function visitParents2(tree, test, visitor, reverse) {
|
|
|
18689
18714
|
}
|
|
18690
18715
|
}
|
|
18691
18716
|
}
|
|
18717
|
+
if (exit && matches) {
|
|
18718
|
+
const exitResult = toResult2(exit(node, parents, index));
|
|
18719
|
+
if (exitResult[0] === SKIP2) {
|
|
18720
|
+
throw new Error("Unexpected value `" + exitResult[0] + "` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");
|
|
18721
|
+
}
|
|
18722
|
+
if (exitResult[0] === EXIT2 || typeof exitResult[1] === "number") {
|
|
18723
|
+
return exitResult;
|
|
18724
|
+
}
|
|
18725
|
+
}
|
|
18692
18726
|
return result;
|
|
18693
18727
|
}
|
|
18694
18728
|
}
|
|
@@ -18714,24 +18748,36 @@ var init_unist_util_visit_parents2 = __esm(() => {
|
|
|
18714
18748
|
});
|
|
18715
18749
|
|
|
18716
18750
|
// ../../node_modules/unist-util-visit/lib/index.js
|
|
18717
|
-
function visit(tree,
|
|
18751
|
+
function visit(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, maybeReverse) {
|
|
18752
|
+
let check;
|
|
18753
|
+
let visitors;
|
|
18718
18754
|
let reverse;
|
|
18719
|
-
|
|
18720
|
-
|
|
18721
|
-
|
|
18722
|
-
test = undefined;
|
|
18723
|
-
visitor = testOrVisitor;
|
|
18724
|
-
reverse = visitorOrReverse;
|
|
18725
|
-
} else {
|
|
18726
|
-
test = testOrVisitor;
|
|
18727
|
-
visitor = visitorOrReverse;
|
|
18755
|
+
if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
|
|
18756
|
+
check = testOrEnterOrVisitors;
|
|
18757
|
+
visitors = enterOrVisitorsOrReverse;
|
|
18728
18758
|
reverse = maybeReverse;
|
|
18759
|
+
} else {
|
|
18760
|
+
visitors = testOrEnterOrVisitors;
|
|
18761
|
+
reverse = enterOrVisitorsOrReverse;
|
|
18729
18762
|
}
|
|
18730
|
-
|
|
18731
|
-
|
|
18732
|
-
|
|
18733
|
-
|
|
18734
|
-
|
|
18763
|
+
if (typeof visitors === "function") {
|
|
18764
|
+
visitParents2(tree, check, wrap2(visitors), reverse);
|
|
18765
|
+
} else {
|
|
18766
|
+
visitParents2(tree, check, wrapVisitors(visitors), reverse);
|
|
18767
|
+
}
|
|
18768
|
+
}
|
|
18769
|
+
function wrapVisitors(visitors) {
|
|
18770
|
+
if (!visitors || typeof visitors !== "object")
|
|
18771
|
+
return visitors;
|
|
18772
|
+
return {
|
|
18773
|
+
enter: typeof visitors.enter === "function" ? wrap2(visitors.enter) : visitors.enter,
|
|
18774
|
+
exit: typeof visitors.exit === "function" ? wrap2(visitors.exit) : visitors.exit
|
|
18775
|
+
};
|
|
18776
|
+
}
|
|
18777
|
+
function wrap2(visitor) {
|
|
18778
|
+
return overload;
|
|
18779
|
+
function overload(node, parents, index) {
|
|
18780
|
+
return visitor(node, index, parents[parents.length - 1]);
|
|
18735
18781
|
}
|
|
18736
18782
|
}
|
|
18737
18783
|
var init_lib16 = __esm(() => {
|
package/dist/markdown.js
CHANGED
|
@@ -18500,16 +18500,43 @@ function color2(d) {
|
|
|
18500
18500
|
}
|
|
18501
18501
|
|
|
18502
18502
|
// ../../node_modules/unist-util-visit/node_modules/unist-util-visit-parents/lib/index.js
|
|
18503
|
-
function visitParents2(tree,
|
|
18503
|
+
function visitParents2(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, reverse) {
|
|
18504
|
+
if (!tree || typeof tree !== "object") {
|
|
18505
|
+
throw new Error("Unexpected value `" + tree + "` for `tree`, expected node");
|
|
18506
|
+
}
|
|
18507
|
+
let preorder = true;
|
|
18504
18508
|
let check;
|
|
18505
|
-
|
|
18506
|
-
|
|
18507
|
-
|
|
18509
|
+
let visitors;
|
|
18510
|
+
let enter;
|
|
18511
|
+
let exit;
|
|
18512
|
+
if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
|
|
18513
|
+
check = testOrEnterOrVisitors;
|
|
18514
|
+
visitors = enterOrVisitorsOrReverse;
|
|
18515
|
+
if (reverse)
|
|
18516
|
+
preorder = false;
|
|
18508
18517
|
} else {
|
|
18509
|
-
|
|
18518
|
+
visitors = testOrEnterOrVisitors;
|
|
18519
|
+
if (enterOrVisitorsOrReverse)
|
|
18520
|
+
preorder = false;
|
|
18521
|
+
}
|
|
18522
|
+
if (typeof visitors === "function") {
|
|
18523
|
+
enter = visitors;
|
|
18524
|
+
} else if (visitors && typeof visitors === "object") {
|
|
18525
|
+
if (visitors.enter === null || visitors.enter === undefined) {} else if (typeof visitors.enter === "function") {
|
|
18526
|
+
enter = visitors.enter;
|
|
18527
|
+
} else {
|
|
18528
|
+
throw new Error("Unexpected value `" + visitors.enter + "` for `visitors.enter`, expected optional visitor");
|
|
18529
|
+
}
|
|
18530
|
+
if (typeof visitors.exit === "function") {
|
|
18531
|
+
exit = visitors.exit;
|
|
18532
|
+
} else {
|
|
18533
|
+
throw new Error("Unexpected value `" + visitors.exit + "` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)");
|
|
18534
|
+
}
|
|
18535
|
+
} else {
|
|
18536
|
+
throw new Error("Unexpected value `" + visitors + "` for `enter` or `visitors`, expected visitor or object with visitors");
|
|
18510
18537
|
}
|
|
18511
18538
|
const is = convert(check);
|
|
18512
|
-
const step =
|
|
18539
|
+
const step = preorder ? 1 : -1;
|
|
18513
18540
|
factory(tree, undefined, [])();
|
|
18514
18541
|
function factory(node, index, parents) {
|
|
18515
18542
|
const value = node && typeof node === "object" ? node : {};
|
|
@@ -18521,12 +18548,10 @@ function visitParents2(tree, test, visitor, reverse) {
|
|
|
18521
18548
|
}
|
|
18522
18549
|
return visit;
|
|
18523
18550
|
function visit() {
|
|
18551
|
+
const matches = !check || is(node, index, parents[parents.length - 1] || undefined);
|
|
18524
18552
|
let result = empty2;
|
|
18525
|
-
|
|
18526
|
-
|
|
18527
|
-
let grandparents;
|
|
18528
|
-
if (!test || is(node, index, parents[parents.length - 1] || undefined)) {
|
|
18529
|
-
result = toResult2(visitor(node, parents));
|
|
18553
|
+
if (enter && matches) {
|
|
18554
|
+
result = toResult2(enter(node, parents, index));
|
|
18530
18555
|
if (result[0] === EXIT2) {
|
|
18531
18556
|
return result;
|
|
18532
18557
|
}
|
|
@@ -18534,11 +18559,11 @@ function visitParents2(tree, test, visitor, reverse) {
|
|
|
18534
18559
|
if ("children" in node && node.children) {
|
|
18535
18560
|
const nodeAsParent = node;
|
|
18536
18561
|
if (nodeAsParent.children && result[0] !== SKIP2) {
|
|
18537
|
-
offset = (
|
|
18538
|
-
grandparents = parents
|
|
18562
|
+
let offset = (preorder ? -1 : nodeAsParent.children.length) + step;
|
|
18563
|
+
const grandparents = [...parents, nodeAsParent];
|
|
18539
18564
|
while (offset > -1 && offset < nodeAsParent.children.length) {
|
|
18540
18565
|
const child = nodeAsParent.children[offset];
|
|
18541
|
-
subresult = factory(child, offset, grandparents)();
|
|
18566
|
+
const subresult = factory(child, offset, grandparents)();
|
|
18542
18567
|
if (subresult[0] === EXIT2) {
|
|
18543
18568
|
return subresult;
|
|
18544
18569
|
}
|
|
@@ -18546,6 +18571,15 @@ function visitParents2(tree, test, visitor, reverse) {
|
|
|
18546
18571
|
}
|
|
18547
18572
|
}
|
|
18548
18573
|
}
|
|
18574
|
+
if (exit && matches) {
|
|
18575
|
+
const exitResult = toResult2(exit(node, parents, index));
|
|
18576
|
+
if (exitResult[0] === SKIP2) {
|
|
18577
|
+
throw new Error("Unexpected value `" + exitResult[0] + "` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");
|
|
18578
|
+
}
|
|
18579
|
+
if (exitResult[0] === EXIT2 || typeof exitResult[1] === "number") {
|
|
18580
|
+
return exitResult;
|
|
18581
|
+
}
|
|
18582
|
+
}
|
|
18549
18583
|
return result;
|
|
18550
18584
|
}
|
|
18551
18585
|
}
|
|
@@ -18571,24 +18605,36 @@ var init_unist_util_visit_parents2 = __esm(() => {
|
|
|
18571
18605
|
});
|
|
18572
18606
|
|
|
18573
18607
|
// ../../node_modules/unist-util-visit/lib/index.js
|
|
18574
|
-
function visit(tree,
|
|
18608
|
+
function visit(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, maybeReverse) {
|
|
18609
|
+
let check;
|
|
18610
|
+
let visitors;
|
|
18575
18611
|
let reverse;
|
|
18576
|
-
|
|
18577
|
-
|
|
18578
|
-
|
|
18579
|
-
test = undefined;
|
|
18580
|
-
visitor = testOrVisitor;
|
|
18581
|
-
reverse = visitorOrReverse;
|
|
18582
|
-
} else {
|
|
18583
|
-
test = testOrVisitor;
|
|
18584
|
-
visitor = visitorOrReverse;
|
|
18612
|
+
if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
|
|
18613
|
+
check = testOrEnterOrVisitors;
|
|
18614
|
+
visitors = enterOrVisitorsOrReverse;
|
|
18585
18615
|
reverse = maybeReverse;
|
|
18616
|
+
} else {
|
|
18617
|
+
visitors = testOrEnterOrVisitors;
|
|
18618
|
+
reverse = enterOrVisitorsOrReverse;
|
|
18586
18619
|
}
|
|
18587
|
-
|
|
18588
|
-
|
|
18589
|
-
|
|
18590
|
-
|
|
18591
|
-
|
|
18620
|
+
if (typeof visitors === "function") {
|
|
18621
|
+
visitParents2(tree, check, wrap2(visitors), reverse);
|
|
18622
|
+
} else {
|
|
18623
|
+
visitParents2(tree, check, wrapVisitors(visitors), reverse);
|
|
18624
|
+
}
|
|
18625
|
+
}
|
|
18626
|
+
function wrapVisitors(visitors) {
|
|
18627
|
+
if (!visitors || typeof visitors !== "object")
|
|
18628
|
+
return visitors;
|
|
18629
|
+
return {
|
|
18630
|
+
enter: typeof visitors.enter === "function" ? wrap2(visitors.enter) : visitors.enter,
|
|
18631
|
+
exit: typeof visitors.exit === "function" ? wrap2(visitors.exit) : visitors.exit
|
|
18632
|
+
};
|
|
18633
|
+
}
|
|
18634
|
+
function wrap2(visitor) {
|
|
18635
|
+
return overload;
|
|
18636
|
+
function overload(node, parents, index) {
|
|
18637
|
+
return visitor(node, index, parents[parents.length - 1]);
|
|
18592
18638
|
}
|
|
18593
18639
|
}
|
|
18594
18640
|
var init_lib16 = __esm(() => {
|
package/dist/serialize.js
CHANGED
|
@@ -9716,16 +9716,43 @@ function color(d) {
|
|
|
9716
9716
|
}
|
|
9717
9717
|
|
|
9718
9718
|
// ../../node_modules/unist-util-visit/node_modules/unist-util-visit-parents/lib/index.js
|
|
9719
|
-
function visitParents(tree,
|
|
9719
|
+
function visitParents(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, reverse) {
|
|
9720
|
+
if (!tree || typeof tree !== "object") {
|
|
9721
|
+
throw new Error("Unexpected value `" + tree + "` for `tree`, expected node");
|
|
9722
|
+
}
|
|
9723
|
+
let preorder = true;
|
|
9720
9724
|
let check;
|
|
9721
|
-
|
|
9722
|
-
|
|
9723
|
-
|
|
9725
|
+
let visitors;
|
|
9726
|
+
let enter;
|
|
9727
|
+
let exit;
|
|
9728
|
+
if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
|
|
9729
|
+
check = testOrEnterOrVisitors;
|
|
9730
|
+
visitors = enterOrVisitorsOrReverse;
|
|
9731
|
+
if (reverse)
|
|
9732
|
+
preorder = false;
|
|
9724
9733
|
} else {
|
|
9725
|
-
|
|
9734
|
+
visitors = testOrEnterOrVisitors;
|
|
9735
|
+
if (enterOrVisitorsOrReverse)
|
|
9736
|
+
preorder = false;
|
|
9737
|
+
}
|
|
9738
|
+
if (typeof visitors === "function") {
|
|
9739
|
+
enter = visitors;
|
|
9740
|
+
} else if (visitors && typeof visitors === "object") {
|
|
9741
|
+
if (visitors.enter === null || visitors.enter === undefined) {} else if (typeof visitors.enter === "function") {
|
|
9742
|
+
enter = visitors.enter;
|
|
9743
|
+
} else {
|
|
9744
|
+
throw new Error("Unexpected value `" + visitors.enter + "` for `visitors.enter`, expected optional visitor");
|
|
9745
|
+
}
|
|
9746
|
+
if (typeof visitors.exit === "function") {
|
|
9747
|
+
exit = visitors.exit;
|
|
9748
|
+
} else {
|
|
9749
|
+
throw new Error("Unexpected value `" + visitors.exit + "` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)");
|
|
9750
|
+
}
|
|
9751
|
+
} else {
|
|
9752
|
+
throw new Error("Unexpected value `" + visitors + "` for `enter` or `visitors`, expected visitor or object with visitors");
|
|
9726
9753
|
}
|
|
9727
9754
|
const is = convert(check);
|
|
9728
|
-
const step =
|
|
9755
|
+
const step = preorder ? 1 : -1;
|
|
9729
9756
|
factory(tree, undefined, [])();
|
|
9730
9757
|
function factory(node, index, parents) {
|
|
9731
9758
|
const value = node && typeof node === "object" ? node : {};
|
|
@@ -9737,12 +9764,10 @@ function visitParents(tree, test, visitor, reverse) {
|
|
|
9737
9764
|
}
|
|
9738
9765
|
return visit;
|
|
9739
9766
|
function visit() {
|
|
9767
|
+
const matches = !check || is(node, index, parents[parents.length - 1] || undefined);
|
|
9740
9768
|
let result = empty;
|
|
9741
|
-
|
|
9742
|
-
|
|
9743
|
-
let grandparents;
|
|
9744
|
-
if (!test || is(node, index, parents[parents.length - 1] || undefined)) {
|
|
9745
|
-
result = toResult(visitor(node, parents));
|
|
9769
|
+
if (enter && matches) {
|
|
9770
|
+
result = toResult(enter(node, parents, index));
|
|
9746
9771
|
if (result[0] === EXIT) {
|
|
9747
9772
|
return result;
|
|
9748
9773
|
}
|
|
@@ -9750,11 +9775,11 @@ function visitParents(tree, test, visitor, reverse) {
|
|
|
9750
9775
|
if ("children" in node && node.children) {
|
|
9751
9776
|
const nodeAsParent = node;
|
|
9752
9777
|
if (nodeAsParent.children && result[0] !== SKIP) {
|
|
9753
|
-
offset = (
|
|
9754
|
-
grandparents = parents
|
|
9778
|
+
let offset = (preorder ? -1 : nodeAsParent.children.length) + step;
|
|
9779
|
+
const grandparents = [...parents, nodeAsParent];
|
|
9755
9780
|
while (offset > -1 && offset < nodeAsParent.children.length) {
|
|
9756
9781
|
const child = nodeAsParent.children[offset];
|
|
9757
|
-
subresult = factory(child, offset, grandparents)();
|
|
9782
|
+
const subresult = factory(child, offset, grandparents)();
|
|
9758
9783
|
if (subresult[0] === EXIT) {
|
|
9759
9784
|
return subresult;
|
|
9760
9785
|
}
|
|
@@ -9762,6 +9787,15 @@ function visitParents(tree, test, visitor, reverse) {
|
|
|
9762
9787
|
}
|
|
9763
9788
|
}
|
|
9764
9789
|
}
|
|
9790
|
+
if (exit && matches) {
|
|
9791
|
+
const exitResult = toResult(exit(node, parents, index));
|
|
9792
|
+
if (exitResult[0] === SKIP) {
|
|
9793
|
+
throw new Error("Unexpected value `" + exitResult[0] + "` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");
|
|
9794
|
+
}
|
|
9795
|
+
if (exitResult[0] === EXIT || typeof exitResult[1] === "number") {
|
|
9796
|
+
return exitResult;
|
|
9797
|
+
}
|
|
9798
|
+
}
|
|
9765
9799
|
return result;
|
|
9766
9800
|
}
|
|
9767
9801
|
}
|
|
@@ -9787,24 +9821,36 @@ var init_unist_util_visit_parents = __esm(() => {
|
|
|
9787
9821
|
});
|
|
9788
9822
|
|
|
9789
9823
|
// ../../node_modules/unist-util-visit/lib/index.js
|
|
9790
|
-
function visit(tree,
|
|
9824
|
+
function visit(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, maybeReverse) {
|
|
9825
|
+
let check;
|
|
9826
|
+
let visitors;
|
|
9791
9827
|
let reverse;
|
|
9792
|
-
|
|
9793
|
-
|
|
9794
|
-
|
|
9795
|
-
test = undefined;
|
|
9796
|
-
visitor = testOrVisitor;
|
|
9797
|
-
reverse = visitorOrReverse;
|
|
9798
|
-
} else {
|
|
9799
|
-
test = testOrVisitor;
|
|
9800
|
-
visitor = visitorOrReverse;
|
|
9828
|
+
if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
|
|
9829
|
+
check = testOrEnterOrVisitors;
|
|
9830
|
+
visitors = enterOrVisitorsOrReverse;
|
|
9801
9831
|
reverse = maybeReverse;
|
|
9832
|
+
} else {
|
|
9833
|
+
visitors = testOrEnterOrVisitors;
|
|
9834
|
+
reverse = enterOrVisitorsOrReverse;
|
|
9802
9835
|
}
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
|
|
9807
|
-
|
|
9836
|
+
if (typeof visitors === "function") {
|
|
9837
|
+
visitParents(tree, check, wrap2(visitors), reverse);
|
|
9838
|
+
} else {
|
|
9839
|
+
visitParents(tree, check, wrapVisitors(visitors), reverse);
|
|
9840
|
+
}
|
|
9841
|
+
}
|
|
9842
|
+
function wrapVisitors(visitors) {
|
|
9843
|
+
if (!visitors || typeof visitors !== "object")
|
|
9844
|
+
return visitors;
|
|
9845
|
+
return {
|
|
9846
|
+
enter: typeof visitors.enter === "function" ? wrap2(visitors.enter) : visitors.enter,
|
|
9847
|
+
exit: typeof visitors.exit === "function" ? wrap2(visitors.exit) : visitors.exit
|
|
9848
|
+
};
|
|
9849
|
+
}
|
|
9850
|
+
function wrap2(visitor) {
|
|
9851
|
+
return overload;
|
|
9852
|
+
function overload(node, parents, index) {
|
|
9853
|
+
return visitor(node, index, parents[parents.length - 1]);
|
|
9808
9854
|
}
|
|
9809
9855
|
}
|
|
9810
9856
|
var init_lib9 = __esm(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jxsuite/parser",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"description": "Jx markdown parser and external class integration",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"upgrade": "bun update --latest && bun install"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@jxsuite/markup": "^1.0.
|
|
52
|
-
"@jxsuite/schema": "^
|
|
51
|
+
"@jxsuite/markup": "^1.0.2",
|
|
52
|
+
"@jxsuite/schema": "^5.0.0",
|
|
53
53
|
"@shikijs/langs": "^4.5.0",
|
|
54
54
|
"@shikijs/themes": "^4.5.0",
|
|
55
55
|
"glob": "^13.0.6",
|
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
"remark-stringify": "^11.0.0",
|
|
63
63
|
"shiki": "^4.5.0",
|
|
64
64
|
"unified": "^11.0.5",
|
|
65
|
-
"unist-util-visit": "^5.
|
|
65
|
+
"unist-util-visit": "^5.2.0",
|
|
66
66
|
"yaml": "^2.9.1"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@happy-dom/global-registrator": "^21.0.4",
|
|
70
|
-
"@jxsuite/runtime": "^
|
|
70
|
+
"@jxsuite/runtime": "^6.0.1",
|
|
71
71
|
"@jxsuite/test-support": "^0.0.0",
|
|
72
72
|
"@types/mdast": "^4.0.4",
|
|
73
73
|
"ajv": "^8.20.0"
|