@jxsuite/parser 4.1.2 → 4.2.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/serialize.js CHANGED
@@ -9682,202 +9682,590 @@ function checkEmphasis(state) {
9682
9682
  return marker;
9683
9683
  }
9684
9684
 
9685
- // ../../node_modules/mdast-util-to-markdown/lib/handle/emphasis.js
9686
- function emphasis(node, _, state, info) {
9687
- const exit = state.enter("phrasing");
9688
- const value = state.containerPhrasing({ type: "root", children: [node] }, info);
9689
- exit();
9690
- return value;
9691
- }
9692
- function attention2(_, state) {
9693
- const marker = checkEmphasis(state);
9694
- return {
9695
- construct: "emphasis",
9696
- markers: marker === "*" ? ["*", "_"] : ["_", "*"],
9697
- sizes: [1]
9698
- };
9685
+ // ../../node_modules/mdast-util-to-markdown/lib/util/character.js
9686
+ function firstCharacter(value) {
9687
+ const code = value.codePointAt(0);
9688
+ return code === undefined ? "" : String.fromCodePoint(code);
9699
9689
  }
9700
- function peek(_, _1, state) {
9701
- return state.options.emphasis || "*";
9690
+ function lastCharacter(value) {
9691
+ const code = value.codePointAt(value.length - 2);
9692
+ return code !== undefined && code > 65535 ? value.slice(-2) : value.slice(-1);
9702
9693
  }
9703
- var init_emphasis = __esm(() => {
9704
- emphasis.attention = attention2;
9705
- emphasis.peek = peek;
9706
- });
9707
9694
 
9708
9695
  // ../../node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js
9709
9696
  function encodeCharacterReference(code) {
9710
9697
  return "&#x" + code.toString(16).toUpperCase() + ";";
9711
9698
  }
9712
9699
 
9713
- // ../../node_modules/unist-util-visit/node_modules/unist-util-visit-parents/lib/color.node.js
9714
- function color(d) {
9715
- return "\x1B[33m" + d + "\x1B[39m";
9700
+ // ../../node_modules/mdast-util-to-markdown/lib/util/encode-info.js
9701
+ function encodeInfo(outside, inside, marker) {
9702
+ const outsideKind = classifyCharacter(outside);
9703
+ const insideKind = classifyCharacter(inside);
9704
+ if (outsideKind === undefined) {
9705
+ return insideKind === undefined ? marker === "_" ? { inside: true, outside: true } : { inside: false, outside: false } : insideKind === 1 ? { inside: true, outside: true } : { inside: false, outside: true };
9706
+ }
9707
+ if (outsideKind === 1) {
9708
+ return insideKind === undefined ? { inside: false, outside: false } : insideKind === 1 ? { inside: true, outside: true } : { inside: false, outside: false };
9709
+ }
9710
+ return insideKind === undefined ? { inside: false, outside: false } : insideKind === 1 ? { inside: true, outside: false } : { inside: false, outside: false };
9716
9711
  }
9712
+ var init_encode_info = __esm(() => {
9713
+ init_dev6();
9714
+ });
9717
9715
 
9718
- // ../../node_modules/unist-util-visit/node_modules/unist-util-visit-parents/lib/index.js
9719
- function visitParents(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, reverse) {
9720
- if (!tree || typeof tree !== "object") {
9721
- throw new Error("Unexpected value `" + tree + "` for `tree`, expected node");
9716
+ // ../../node_modules/mdast-util-to-markdown/lib/util/html-kind.js
9717
+ function htmlKind(value) {
9718
+ if (value.charCodeAt(0) !== 60)
9719
+ return;
9720
+ const next = value.charCodeAt(1);
9721
+ if (next === 33) {
9722
+ const code = value.charCodeAt(2);
9723
+ if (code === 45)
9724
+ return 2;
9725
+ if (code === 91)
9726
+ return 5;
9727
+ if (asciiAlpha(code))
9728
+ return 4;
9729
+ return;
9722
9730
  }
9723
- let preorder = true;
9724
- let check;
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;
9733
- } else {
9734
- visitors = testOrEnterOrVisitors;
9735
- if (enterOrVisitorsOrReverse)
9736
- preorder = false;
9731
+ if (next === 63)
9732
+ return 3;
9733
+ const closing = next === 47;
9734
+ const start = closing ? 2 : 1;
9735
+ let end = start;
9736
+ let code = value.charCodeAt(end);
9737
+ if (!asciiAlpha(code))
9738
+ return;
9739
+ while (code === 45 || asciiAlphanumeric(code)) {
9740
+ code = value.charCodeAt(++end);
9737
9741
  }
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");
9742
+ const name = value.slice(start, end).toLowerCase();
9743
+ if (!closing && code !== 47 && htmlRawNames.includes(name)) {
9744
+ return 1;
9745
+ }
9746
+ return htmlBlockNames.includes(name) ? 6 : 7;
9747
+ }
9748
+ var init_html_kind = __esm(() => {
9749
+ init_dev4();
9750
+ init_micromark_util_html_tag_name();
9751
+ });
9752
+
9753
+ // ../../node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
9754
+ function candidates(tokens, involved, runOf) {
9755
+ const related = new Set;
9756
+ for (const token of tokens) {
9757
+ const siblings = runOf.get(token);
9758
+ if (siblings && token.attention && involved.some((d) => d.attention === token.attention)) {
9759
+ for (const sibling of siblings.tokens) {
9760
+ related.add(sibling.attention);
9761
+ }
9745
9762
  }
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)");
9763
+ }
9764
+ const ordered = [];
9765
+ for (const token of tokens) {
9766
+ if (token.attention && related.delete(token.attention)) {
9767
+ ordered.push(token.attention);
9750
9768
  }
9751
- } else {
9752
- throw new Error("Unexpected value `" + visitors + "` for `enter` or `visitors`, expected visitor or object with visitors");
9753
9769
  }
9754
- const is = convert(check);
9755
- const step = preorder ? 1 : -1;
9756
- factory(tree, undefined, [])();
9757
- function factory(node, index, parents) {
9758
- const value = node && typeof node === "object" ? node : {};
9759
- if (typeof value.type === "string") {
9760
- const name = typeof value.tagName === "string" ? value.tagName : typeof value.name === "string" ? value.name : undefined;
9761
- Object.defineProperty(visit, "name", {
9762
- value: "node (" + color(node.type + (name ? "<" + name + ">" : "")) + ")"
9763
- });
9770
+ ordered.reverse();
9771
+ return ordered;
9772
+ }
9773
+ function check(tokens, before, after) {
9774
+ const runs = [];
9775
+ const wrong = new Map;
9776
+ const runOf = new Map;
9777
+ let index = 0;
9778
+ while (index < tokens.length) {
9779
+ if (!tokens[index].attention) {
9780
+ index++;
9781
+ continue;
9764
9782
  }
9765
- return visit;
9766
- function visit() {
9767
- const matches = !check || is(node, index, parents[parents.length - 1] || undefined);
9768
- let result = empty;
9769
- if (enter && matches) {
9770
- result = toResult(enter(node, parents, index));
9771
- if (result[0] === EXIT) {
9772
- return result;
9773
- }
9783
+ const marker = tokens[index].value.charAt(0);
9784
+ const strict = builtins.get(marker);
9785
+ let end = index + 1;
9786
+ while (end < tokens.length && tokens[end].attention && tokens[end].value.charAt(0) === marker) {
9787
+ end++;
9788
+ }
9789
+ const head = index ? tokens[index - 1].value : before;
9790
+ const previous = classifyCharacter(head.charCodeAt(head.length - 1));
9791
+ const next = classifyCharacter((end < tokens.length ? tokens[end].value : after).charCodeAt(0));
9792
+ const open = !next || next === 2 && Boolean(previous);
9793
+ const close = !previous || previous === 2 && Boolean(next);
9794
+ const run = {
9795
+ tokens: tokens.slice(index, end),
9796
+ markers: [],
9797
+ start: 0,
9798
+ end: 0,
9799
+ open: strict ? open && (Boolean(previous) || !close) : open,
9800
+ close: strict ? close && (Boolean(next) || !open) : close,
9801
+ split: strict !== undefined
9802
+ };
9803
+ for (const token of run.tokens) {
9804
+ wrong.set(token, [...run.tokens]);
9805
+ runOf.set(token, run);
9806
+ let size = token.value.length;
9807
+ while (size--)
9808
+ run.markers.push(token);
9809
+ }
9810
+ run.end = run.markers.length;
9811
+ runs.push(run);
9812
+ index = end;
9813
+ }
9814
+ pair(runs, wrong);
9815
+ index = -1;
9816
+ while (++index < tokens.length) {
9817
+ const involved = wrong.get(tokens[index]);
9818
+ if (involved)
9819
+ return { attention: candidates(tokens, involved, runOf), index };
9820
+ }
9821
+ }
9822
+ function containerPhrasing(parent, state, info) {
9823
+ return serialize(phrasing2(parent, state, info), info.before, info.after);
9824
+ }
9825
+ function encode(tokens, start) {
9826
+ const token = tokens[start ? 0 : tokens.length - 1];
9827
+ if (!token || token.attention)
9828
+ return;
9829
+ const character = start ? firstCharacter(token.value) : lastCharacter(token.value);
9830
+ const reference = encodeCharacterReference(character.codePointAt(0));
9831
+ if (start) {
9832
+ token.value = reference + token.value.slice(character.length);
9833
+ } else {
9834
+ let value = token.value.slice(0, token.value.length - character.length);
9835
+ let escapes = 0;
9836
+ while (value.charCodeAt(value.length - 1 - escapes) === 92) {
9837
+ escapes++;
9838
+ }
9839
+ if (escapes % 2)
9840
+ value += "\\";
9841
+ token.value = value + reference;
9842
+ }
9843
+ }
9844
+ function improve(items, chosen, mistake, before, after) {
9845
+ for (const attention of mistake.attention) {
9846
+ const current = chosen.get(attention) || attention.sequences[0];
9847
+ for (const sequence of attention.sequences) {
9848
+ if (sequence === current)
9849
+ continue;
9850
+ const trial = new Map(chosen);
9851
+ trial.set(attention, sequence);
9852
+ const tokens = render(items, trial, before, after);
9853
+ const next = check(tokens, before, after);
9854
+ if (!next || next.index > mistake.index) {
9855
+ return { chosen: trial, mistake: next, tokens };
9774
9856
  }
9775
- if ("children" in node && node.children) {
9776
- const nodeAsParent = node;
9777
- if (nodeAsParent.children && result[0] !== SKIP) {
9778
- let offset = (preorder ? -1 : nodeAsParent.children.length) + step;
9779
- const grandparents = [...parents, nodeAsParent];
9780
- while (offset > -1 && offset < nodeAsParent.children.length) {
9781
- const child = nodeAsParent.children[offset];
9782
- const subresult = factory(child, offset, grandparents)();
9783
- if (subresult[0] === EXIT) {
9784
- return subresult;
9785
- }
9786
- offset = typeof subresult[1] === "number" ? subresult[1] : offset + step;
9787
- }
9788
- }
9857
+ }
9858
+ }
9859
+ }
9860
+ function pair(runs, wrong) {
9861
+ const openersByMarker = new Map;
9862
+ for (const closer of runs) {
9863
+ const marker = closer.tokens[0].value.charAt(0);
9864
+ let openers = openersByMarker.get(marker);
9865
+ if (!openers) {
9866
+ openers = [];
9867
+ openersByMarker.set(marker, openers);
9868
+ }
9869
+ let open = closer.close ? openers.length : 0;
9870
+ while (open-- && closer.start < closer.end) {
9871
+ const opener = openers[open];
9872
+ const openerSize = opener.end - opener.start;
9873
+ const closerSize = closer.end - closer.start;
9874
+ if (closer.split ? (opener.close || closer.open) && closerSize % 3 && !((openerSize + closerSize) % 3) : openerSize !== opener.markers.length || openerSize !== closerSize) {
9875
+ continue;
9789
9876
  }
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;
9877
+ const size = closer.split ? openerSize > 1 && closerSize > 1 ? 2 : 1 : closerSize;
9878
+ const opening = opener.markers.slice(opener.end - size, opener.end);
9879
+ const closing = closer.markers.slice(closer.start, closer.start + size);
9880
+ const openToken = opening[0];
9881
+ const closeToken = closing[0];
9882
+ if (openToken === opening[size - 1] && openToken.value.length === size && closeToken === closing[size - 1] && closeToken.value.length === size && openToken.attention === closeToken.attention) {
9883
+ wrong.delete(openToken);
9884
+ wrong.delete(closeToken);
9885
+ } else {
9886
+ const involved = [...new Set([...opening, ...closing])];
9887
+ for (const token of involved) {
9888
+ const list = wrong.get(token);
9889
+ if (list)
9890
+ list.push(...involved);
9797
9891
  }
9798
9892
  }
9799
- return result;
9893
+ opener.end -= size;
9894
+ closer.start += size;
9895
+ if (opener.start === opener.end)
9896
+ openers.splice(open, 1);
9897
+ open = openers.length;
9800
9898
  }
9899
+ if (closer.open && closer.start < closer.end)
9900
+ openers.push(closer);
9801
9901
  }
9802
9902
  }
9803
- function toResult(value) {
9804
- if (Array.isArray(value)) {
9805
- return value;
9903
+ function attentionSequences(type, markers, sizes) {
9904
+ if (markers.length === 0) {
9905
+ throw new Error("Cannot serialize `" + type + "` as attention without markers, expected one or more markers");
9806
9906
  }
9807
- if (typeof value === "number") {
9808
- return [CONTINUE, value];
9907
+ if (sizes.length === 0) {
9908
+ throw new Error("Cannot serialize `" + type + "` as attention without sizes, expected one or more sizes");
9809
9909
  }
9810
- return value === null || value === undefined ? empty : [value];
9910
+ for (const size of sizes) {
9911
+ if (!Number.isSafeInteger(size) || size < 1) {
9912
+ throw new Error("Cannot serialize `" + type + "` as attention with `" + size + "` as size, expected positive integer");
9913
+ }
9914
+ }
9915
+ const sequences = [];
9916
+ for (const marker of markers) {
9917
+ if (marker.length !== 1) {
9918
+ throw new Error("Cannot serialize `" + type + "` as attention with `" + marker + "` as marker, expected a single ascii character");
9919
+ }
9920
+ if (!asciiPunctuation(marker.charCodeAt(0))) {
9921
+ throw new Error("Cannot serialize `" + type + "` as attention with `" + marker + "` as marker, expected ascii punctuation");
9922
+ }
9923
+ for (const size of sizes) {
9924
+ sequences.push(marker.repeat(size));
9925
+ }
9926
+ }
9927
+ return sequences;
9811
9928
  }
9812
- var empty, CONTINUE = true, EXIT = false, SKIP = "skip";
9813
- var init_lib8 = __esm(() => {
9814
- init_unist_util_is();
9815
- empty = [];
9929
+ function phrasing2(parent, state, info) {
9930
+ const indexStack = state.indexStack;
9931
+ const children = parent.children || [];
9932
+ const results = [];
9933
+ let index = -1;
9934
+ let before = info.before;
9935
+ indexStack.push(-1);
9936
+ let tracker = state.createTracker(info);
9937
+ while (++index < children.length) {
9938
+ const child = children[index];
9939
+ let after;
9940
+ indexStack[indexStack.length - 1] = index;
9941
+ if (index + 1 < children.length) {
9942
+ let handle = state.handle.handlers[children[index + 1].type];
9943
+ if (handle && handle.peek)
9944
+ handle = handle.peek;
9945
+ after = handle ? firstCharacter(handle(children[index + 1], parent, state, {
9946
+ before: "",
9947
+ after: "",
9948
+ ...tracker.current()
9949
+ })) : "";
9950
+ } else {
9951
+ after = info.after;
9952
+ }
9953
+ const previous = results[results.length - 1];
9954
+ if (typeof previous === "string" && (before === "\r" || before === `
9955
+ `) && child.type === "html" && htmlKind(child.value) !== 7) {
9956
+ results[results.length - 1] = previous.replace(/(\r?\n|\r)$/, " ");
9957
+ before = " ";
9958
+ tracker = state.createTracker(info);
9959
+ tracker.move(serialize(results, info.before, info.after));
9960
+ }
9961
+ const handle = state.handle.handlers[child.type];
9962
+ if (handle && handle.attention) {
9963
+ const item = attentionItem(child, handle.attention, state, tracker);
9964
+ results.push(item);
9965
+ before = lastCharacter(item.sequences[0]);
9966
+ } else {
9967
+ const value = state.handle(child, parent, state, {
9968
+ ...tracker.current(),
9969
+ after,
9970
+ before
9971
+ });
9972
+ if (!value)
9973
+ continue;
9974
+ tracker.move(value);
9975
+ results.push(value);
9976
+ before = lastCharacter(value);
9977
+ }
9978
+ }
9979
+ indexStack.pop();
9980
+ return results;
9981
+ }
9982
+ function attentionItem(node, attention, state, tracker) {
9983
+ const { construct, markers, sizes } = attention(node, state);
9984
+ const sequences = attentionSequences(node.type, markers, sizes);
9985
+ const sequence = sequences[0];
9986
+ const exit = state.enter(construct);
9987
+ tracker.move(sequence);
9988
+ const children = phrasing2(node, state, {
9989
+ ...tracker.current(),
9990
+ before: sequence,
9991
+ after: sequence
9992
+ });
9993
+ tracker.move(serialize(children, sequence, sequence));
9994
+ tracker.move(sequence);
9995
+ exit();
9996
+ return { children, sequences };
9997
+ }
9998
+ function render(items, chosen, before, after) {
9999
+ const tokens = [];
10000
+ let encodeAfter;
10001
+ let previous = lastCharacter(before);
10002
+ let index = -1;
10003
+ while (++index < items.length) {
10004
+ const item = items[index];
10005
+ if (typeof item === "string") {
10006
+ const token = { value: item, attention: undefined };
10007
+ if (encodeAfter && encodeAfter === firstCharacter(item)) {
10008
+ encode([token], true);
10009
+ }
10010
+ encodeAfter = undefined;
10011
+ tokens.push(token);
10012
+ if (token.value)
10013
+ previous = lastCharacter(token.value);
10014
+ continue;
10015
+ }
10016
+ const sequence = chosen.get(item) || item.sequences[0];
10017
+ const marker = sequence.charAt(0);
10018
+ const next = items[index + 1];
10019
+ const outsideBefore = previous;
10020
+ const outsideAfter = firstCharacter(next === undefined ? after : typeof next === "string" ? next : chosen.get(next) || next.sequences[0]);
10021
+ const inside = render(item.children, chosen, sequence, sequence);
10022
+ const head = inside.length > 0 ? inside[0].value : "";
10023
+ const open = encodeInfo(outsideBefore.charCodeAt(outsideBefore.length - 1), head.charCodeAt(0), marker);
10024
+ if (open.inside)
10025
+ encode(inside, true);
10026
+ const tail = inside.length > 0 ? lastCharacter(inside[inside.length - 1].value) : "";
10027
+ const close = encodeInfo(outsideAfter.charCodeAt(0), tail.charCodeAt(tail.length - 1), marker);
10028
+ if (close.inside)
10029
+ encode(inside, false);
10030
+ if (open.outside && outsideBefore !== `
10031
+ ` && outsideBefore !== "\r") {
10032
+ encode(tokens, false);
10033
+ }
10034
+ if (close.outside)
10035
+ encodeAfter = outsideAfter;
10036
+ tokens.push({ value: sequence, attention: item }, ...inside, {
10037
+ value: sequence,
10038
+ attention: item
10039
+ });
10040
+ previous = sequence.charAt(sequence.length - 1);
10041
+ }
10042
+ return tokens;
10043
+ }
10044
+ function serialize(items, before, after) {
10045
+ let chosen = new Map;
10046
+ const initial = render(items, chosen, before, after);
10047
+ let tokens = initial;
10048
+ let mistake = check(tokens, before, after);
10049
+ while (mistake) {
10050
+ const next = improve(items, chosen, mistake, before, after);
10051
+ if (!next) {
10052
+ tokens = initial;
10053
+ break;
10054
+ }
10055
+ chosen = next.chosen;
10056
+ tokens = next.tokens;
10057
+ mistake = next.mistake;
10058
+ }
10059
+ let result = "";
10060
+ for (const token of tokens)
10061
+ result += token.value;
10062
+ return result;
10063
+ }
10064
+ var builtins;
10065
+ var init_container_phrasing = __esm(() => {
10066
+ init_dev4();
10067
+ init_dev6();
10068
+ init_encode_info();
10069
+ init_html_kind();
10070
+ builtins = new Map([
10071
+ ["*", false],
10072
+ ["_", true]
10073
+ ]);
9816
10074
  });
9817
10075
 
9818
- // ../../node_modules/unist-util-visit/node_modules/unist-util-visit-parents/index.js
9819
- var init_unist_util_visit_parents = __esm(() => {
9820
- init_lib8();
10076
+ // ../../node_modules/mdast-util-to-markdown/lib/handle/emphasis.js
10077
+ function emphasis(node, _, state, info) {
10078
+ const exit = state.enter("phrasing");
10079
+ const item = attentionItem(node, attention2, state, state.createTracker(info));
10080
+ const value = serialize([item], info.before, info.after);
10081
+ exit();
10082
+ return value;
10083
+ }
10084
+ function attention2(_, state) {
10085
+ const marker = checkEmphasis(state);
10086
+ return {
10087
+ construct: "emphasis",
10088
+ markers: marker === "*" ? ["*", "_"] : ["_", "*"],
10089
+ sizes: [1]
10090
+ };
10091
+ }
10092
+ function peek(_, _1, state) {
10093
+ return state.options.emphasis || "*";
10094
+ }
10095
+ var init_emphasis = __esm(() => {
10096
+ init_container_phrasing();
10097
+ emphasis.attention = attention2;
10098
+ emphasis.peek = peek;
9821
10099
  });
9822
10100
 
9823
- // ../../node_modules/unist-util-visit/lib/index.js
9824
- function visit(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, maybeReverse) {
10101
+ // ../../node_modules/unist-util-visit/node_modules/unist-util-visit-parents/lib/color.node.js
10102
+ function color(d) {
10103
+ return "\x1B[33m" + d + "\x1B[39m";
10104
+ }
10105
+
10106
+ // ../../node_modules/unist-util-visit/node_modules/unist-util-visit-parents/lib/index.js
10107
+ function visitParents(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, reverse) {
10108
+ if (!tree || typeof tree !== "object") {
10109
+ throw new Error("Unexpected value `" + tree + "` for `tree`, expected node");
10110
+ }
10111
+ let preorder = true;
9825
10112
  let check;
9826
10113
  let visitors;
9827
- let reverse;
10114
+ let enter;
10115
+ let exit;
9828
10116
  if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
9829
10117
  check = testOrEnterOrVisitors;
9830
10118
  visitors = enterOrVisitorsOrReverse;
9831
- reverse = maybeReverse;
10119
+ if (reverse)
10120
+ preorder = false;
9832
10121
  } else {
9833
10122
  visitors = testOrEnterOrVisitors;
9834
- reverse = enterOrVisitorsOrReverse;
10123
+ if (enterOrVisitorsOrReverse)
10124
+ preorder = false;
9835
10125
  }
9836
10126
  if (typeof visitors === "function") {
9837
- visitParents(tree, check, wrap2(visitors), reverse);
10127
+ enter = visitors;
10128
+ } else if (visitors && typeof visitors === "object") {
10129
+ if (visitors.enter === null || visitors.enter === undefined) {} else if (typeof visitors.enter === "function") {
10130
+ enter = visitors.enter;
10131
+ } else {
10132
+ throw new Error("Unexpected value `" + visitors.enter + "` for `visitors.enter`, expected optional visitor");
10133
+ }
10134
+ if (typeof visitors.exit === "function") {
10135
+ exit = visitors.exit;
10136
+ } else {
10137
+ throw new Error("Unexpected value `" + visitors.exit + "` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)");
10138
+ }
9838
10139
  } 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]);
10140
+ throw new Error("Unexpected value `" + visitors + "` for `enter` or `visitors`, expected visitor or object with visitors");
9854
10141
  }
9855
- }
9856
- var init_lib9 = __esm(() => {
9857
- init_unist_util_visit_parents();
9858
- init_unist_util_visit_parents();
9859
- });
9860
-
9861
- // ../../node_modules/unist-util-visit/index.js
9862
- var init_unist_util_visit = __esm(() => {
9863
- init_lib9();
9864
- });
9865
-
9866
- // ../../node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js
9867
- function formatHeadingAsSetext(node, state) {
9868
- let literalWithBreak = false;
9869
- visit(node, function(node) {
9870
- if ("value" in node && /\r?\n|\r/.test(node.value) || node.type === "break") {
9871
- literalWithBreak = true;
9872
- return EXIT;
9873
- }
9874
- });
9875
- return Boolean((!node.depth || node.depth < 3) && toString(node) && (state.options.setext || literalWithBreak));
9876
- }
9877
- var init_format_heading_as_setext = __esm(() => {
9878
- init_unist_util_visit();
9879
- init_mdast_util_to_string();
9880
- });
10142
+ const is = convert(check);
10143
+ const step = preorder ? 1 : -1;
10144
+ factory(tree, undefined, [])();
10145
+ function factory(node, index, parents) {
10146
+ const value = node && typeof node === "object" ? node : {};
10147
+ if (typeof value.type === "string") {
10148
+ const name = typeof value.tagName === "string" ? value.tagName : typeof value.name === "string" ? value.name : undefined;
10149
+ Object.defineProperty(visit, "name", {
10150
+ value: "node (" + color(node.type + (name ? "<" + name + ">" : "")) + ")"
10151
+ });
10152
+ }
10153
+ return visit;
10154
+ function visit() {
10155
+ const matches = !check || is(node, index, parents[parents.length - 1] || undefined);
10156
+ let result = empty;
10157
+ if (enter && matches) {
10158
+ result = toResult(enter(node, parents, index));
10159
+ if (result[0] === EXIT) {
10160
+ return result;
10161
+ }
10162
+ }
10163
+ if ("children" in node && node.children) {
10164
+ const nodeAsParent = node;
10165
+ if (nodeAsParent.children && result[0] !== SKIP) {
10166
+ let offset = (preorder ? -1 : nodeAsParent.children.length) + step;
10167
+ const grandparents = [...parents, nodeAsParent];
10168
+ while (offset > -1 && offset < nodeAsParent.children.length) {
10169
+ const child = nodeAsParent.children[offset];
10170
+ const subresult = factory(child, offset, grandparents)();
10171
+ if (subresult[0] === EXIT) {
10172
+ return subresult;
10173
+ }
10174
+ offset = typeof subresult[1] === "number" ? subresult[1] : offset + step;
10175
+ }
10176
+ }
10177
+ }
10178
+ if (exit && matches) {
10179
+ const exitResult = toResult(exit(node, parents, index));
10180
+ if (exitResult[0] === SKIP) {
10181
+ throw new Error("Unexpected value `" + exitResult[0] + "` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");
10182
+ }
10183
+ if (exitResult[0] === EXIT || typeof exitResult[1] === "number") {
10184
+ return exitResult;
10185
+ }
10186
+ }
10187
+ return result;
10188
+ }
10189
+ }
10190
+ }
10191
+ function toResult(value) {
10192
+ if (Array.isArray(value)) {
10193
+ return value;
10194
+ }
10195
+ if (typeof value === "number") {
10196
+ return [CONTINUE, value];
10197
+ }
10198
+ return value === null || value === undefined ? empty : [value];
10199
+ }
10200
+ var empty, CONTINUE = true, EXIT = false, SKIP = "skip";
10201
+ var init_lib8 = __esm(() => {
10202
+ init_unist_util_is();
10203
+ empty = [];
10204
+ });
10205
+
10206
+ // ../../node_modules/unist-util-visit/node_modules/unist-util-visit-parents/index.js
10207
+ var init_unist_util_visit_parents = __esm(() => {
10208
+ init_lib8();
10209
+ });
10210
+
10211
+ // ../../node_modules/unist-util-visit/lib/index.js
10212
+ function visit(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, maybeReverse) {
10213
+ let check;
10214
+ let visitors;
10215
+ let reverse;
10216
+ if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
10217
+ check = testOrEnterOrVisitors;
10218
+ visitors = enterOrVisitorsOrReverse;
10219
+ reverse = maybeReverse;
10220
+ } else {
10221
+ visitors = testOrEnterOrVisitors;
10222
+ reverse = enterOrVisitorsOrReverse;
10223
+ }
10224
+ if (typeof visitors === "function") {
10225
+ visitParents(tree, check, wrap2(visitors), reverse);
10226
+ } else {
10227
+ visitParents(tree, check, wrapVisitors(visitors), reverse);
10228
+ }
10229
+ }
10230
+ function wrapVisitors(visitors) {
10231
+ if (!visitors || typeof visitors !== "object")
10232
+ return visitors;
10233
+ return {
10234
+ enter: typeof visitors.enter === "function" ? wrap2(visitors.enter) : visitors.enter,
10235
+ exit: typeof visitors.exit === "function" ? wrap2(visitors.exit) : visitors.exit
10236
+ };
10237
+ }
10238
+ function wrap2(visitor) {
10239
+ return overload;
10240
+ function overload(node, parents, index) {
10241
+ return visitor(node, index, parents[parents.length - 1]);
10242
+ }
10243
+ }
10244
+ var init_lib9 = __esm(() => {
10245
+ init_unist_util_visit_parents();
10246
+ init_unist_util_visit_parents();
10247
+ });
10248
+
10249
+ // ../../node_modules/unist-util-visit/index.js
10250
+ var init_unist_util_visit = __esm(() => {
10251
+ init_lib9();
10252
+ });
10253
+
10254
+ // ../../node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js
10255
+ function formatHeadingAsSetext(node, state) {
10256
+ let literalWithBreak = false;
10257
+ visit(node, function(node) {
10258
+ if ("value" in node && /\r?\n|\r/.test(node.value) || node.type === "break") {
10259
+ literalWithBreak = true;
10260
+ return EXIT;
10261
+ }
10262
+ });
10263
+ return Boolean((!node.depth || node.depth < 3) && toString(node) && (state.options.setext || literalWithBreak));
10264
+ }
10265
+ var init_format_heading_as_setext = __esm(() => {
10266
+ init_unist_util_visit();
10267
+ init_mdast_util_to_string();
10268
+ });
9881
10269
 
9882
10270
  // ../../node_modules/mdast-util-to-markdown/lib/handle/heading.js
9883
10271
  function heading(node, _, state, info) {
@@ -10094,14 +10482,27 @@ function link(node, _, state, info) {
10094
10482
  const exit = state.enter("link");
10095
10483
  let subexit = state.enter("label");
10096
10484
  let value = tracker.move("[");
10097
- value += tracker.move(state.containerPhrasing(node, {
10485
+ const text = state.containerPhrasing(node, {
10098
10486
  before: value,
10099
10487
  after: "](",
10100
10488
  ...tracker.current()
10101
- }));
10102
- value += tracker.move("](");
10489
+ });
10490
+ value += tracker.move(text);
10103
10491
  subexit();
10104
- if (!node.url && node.title || /[\0- \u007F]/.test(node.url)) {
10492
+ value += tracker.move("](");
10493
+ const enclose = /[\0- \u007F]/.test(node.url);
10494
+ const last = info.before.charAt(info.before.length - 1);
10495
+ let title = node.title || undefined;
10496
+ if (!title && !enclose && (last === `
10497
+ ` || last === "\r")) {
10498
+ let index = 0;
10499
+ while (index < text.length && text.charCodeAt(index) !== 93) {
10500
+ index += text.charCodeAt(index) === 92 ? 2 : 1;
10501
+ }
10502
+ if (text.charCodeAt(index + 1) === 58)
10503
+ title = "";
10504
+ }
10505
+ if (!node.url && typeof title === "string" || enclose) {
10105
10506
  subexit = state.enter("destinationLiteral");
10106
10507
  value += tracker.move("<");
10107
10508
  value += tracker.move(state.safe(node.url, { before: value, after: ">", ...tracker.current() }));
@@ -10110,15 +10511,15 @@ function link(node, _, state, info) {
10110
10511
  subexit = state.enter("destinationRaw");
10111
10512
  value += tracker.move(state.safe(node.url, {
10112
10513
  before: value,
10113
- after: node.title ? " " : ")",
10514
+ after: typeof title === "string" ? " " : ")",
10114
10515
  ...tracker.current()
10115
10516
  }));
10116
10517
  }
10117
10518
  subexit();
10118
- if (node.title) {
10519
+ if (typeof title === "string") {
10119
10520
  subexit = state.enter(`title${suffix}`);
10120
10521
  value += tracker.move(" " + quote);
10121
- value += tracker.move(state.safe(node.title, {
10522
+ value += tracker.move(state.safe(title, {
10122
10523
  before: value,
10123
10524
  after: quote,
10124
10525
  ...tracker.current()
@@ -10336,7 +10737,8 @@ function checkStrong(state) {
10336
10737
  // ../../node_modules/mdast-util-to-markdown/lib/handle/strong.js
10337
10738
  function strong(node, _, state, info) {
10338
10739
  const exit = state.enter("phrasing");
10339
- const value = state.containerPhrasing({ type: "root", children: [node] }, info);
10740
+ const item = attentionItem(node, attention3, state, state.createTracker(info));
10741
+ const value = serialize([item], info.before, info.after);
10340
10742
  exit();
10341
10743
  return value;
10342
10744
  }
@@ -10352,6 +10754,7 @@ function peek2(_, _1, state) {
10352
10754
  return state.options.strong || "*";
10353
10755
  }
10354
10756
  var init_strong = __esm(() => {
10757
+ init_container_phrasing();
10355
10758
  strong.attention = attention3;
10356
10759
  strong.peek = peek2;
10357
10760
  });
@@ -10359,7 +10762,7 @@ var init_strong = __esm(() => {
10359
10762
  // ../../node_modules/mdast-util-to-markdown/lib/handle/text.js
10360
10763
  function text3(node, parent, state, info) {
10361
10764
  const siblings = parent ? parent.children : [];
10362
- const index = siblings.indexOf(node);
10765
+ const index = state.indexStack[state.indexStack.length - 1];
10363
10766
  return state.safe(node.value, {
10364
10767
  ...info,
10365
10768
  afterNode: siblings[index + 1],
@@ -10426,63 +10829,44 @@ var init_handle = __esm(() => {
10426
10829
  };
10427
10830
  });
10428
10831
 
10429
- // ../../node_modules/mdast-util-to-markdown/lib/util/html-kind.js
10430
- function htmlKind(value) {
10431
- if (value.charCodeAt(0) !== 60)
10432
- return;
10433
- const next = value.charCodeAt(1);
10434
- if (next === 33) {
10435
- const code = value.charCodeAt(2);
10436
- if (code === 45)
10437
- return 2;
10438
- if (code === 91)
10439
- return 5;
10440
- if (asciiAlpha(code))
10441
- return 4;
10442
- return;
10443
- }
10444
- if (next === 63)
10445
- return 3;
10446
- const closing = next === 47;
10447
- const start = closing ? 2 : 1;
10448
- let end = start;
10449
- let code = value.charCodeAt(end);
10450
- if (!asciiAlpha(code))
10451
- return;
10452
- while (code === 45 || asciiAlphanumeric(code)) {
10453
- code = value.charCodeAt(++end);
10454
- }
10455
- const name = value.slice(start, end).toLowerCase();
10456
- if (!closing && code !== 47 && htmlRawNames.includes(name)) {
10457
- return 1;
10458
- }
10459
- return htmlBlockNames.includes(name) ? 6 : 7;
10460
- }
10461
- var init_html_kind = __esm(() => {
10462
- init_dev4();
10463
- init_micromark_util_html_tag_name();
10464
- });
10465
-
10466
10832
  // ../../node_modules/mdast-util-to-markdown/lib/join.js
10467
10833
  function joinDefaults(left, right, parent, state) {
10468
10834
  if (right.type === "code" && formatCodeAsIndented(right, state) && (left.type === "list" || left.type === right.type && formatCodeAsIndented(left, state))) {
10469
10835
  return false;
10470
10836
  }
10471
10837
  if ("spread" in parent && typeof parent.spread === "boolean") {
10472
- if (left.type === "paragraph" && (left.type === right.type || right.type === "definition" || right.type === "heading" && formatHeadingAsSetext(right, state))) {
10473
- return;
10474
- }
10838
+ if (parent.spread)
10839
+ return 1;
10475
10840
  if (left.type === "html") {
10476
10841
  const kind = htmlKind(left.value);
10477
10842
  if (kind === undefined || kind === 6 || kind === 7)
10478
10843
  return 1;
10479
10844
  }
10480
- if (left.type === "paragraph" && right.type === "html") {
10845
+ if (left.type === "blockquote" && right.type === "blockquote")
10846
+ return 1;
10847
+ if ((left.type === "definition" || left.type === "paragraph") && right.type === "list" && (right.ordered && typeof right.start === "number" && right.start !== 1 || right.children.length > 0 && right.children[0].children.length === 0)) {
10848
+ return 1;
10849
+ }
10850
+ if (left.type === "paragraph" && right.type === "thematicBreak" && checkRule(state) === "-" && !state.options.ruleSpaces) {
10851
+ return 1;
10852
+ }
10853
+ let tail = left;
10854
+ while ((tail.type === "blockquote" || tail.type === "list" || tail.type === "listItem") && tail.children.length > 0) {
10855
+ tail = tail.children[tail.children.length - 1];
10856
+ }
10857
+ if (tail.type !== "definition" && tail.type !== "paragraph")
10858
+ return 0;
10859
+ if (right.type === "code" && formatCodeAsIndented(right, state))
10860
+ return 1;
10861
+ if (right.type === "html") {
10481
10862
  const kind = htmlKind(right.value);
10482
10863
  if (kind === undefined || kind === 7)
10483
10864
  return 1;
10484
10865
  }
10485
- return parent.spread ? 1 : 0;
10866
+ if ((left.type === "paragraph" || left !== tail) && (right.type === "definition" || right.type === "heading" && formatHeadingAsSetext(right, state) || right.type === "paragraph")) {
10867
+ return 1;
10868
+ }
10869
+ return 0;
10486
10870
  }
10487
10871
  }
10488
10872
  var join;
@@ -10555,7 +10939,21 @@ var init_unsafe = __esm(() => {
10555
10939
  { atBreak: true, character: "#" },
10556
10940
  { character: "#", inConstruct: "headingAtx", after: `(?:[\r
10557
10941
  ]|$)` },
10558
- { character: "&", after: "[#A-Za-z]", inConstruct: "phrasing" },
10942
+ {
10943
+ character: "&",
10944
+ after: "[#A-Za-z]",
10945
+ inConstruct: [
10946
+ "codeFencedLangGraveAccent",
10947
+ "codeFencedLangTilde",
10948
+ "codeFencedMetaGraveAccent",
10949
+ "codeFencedMetaTilde",
10950
+ "destinationLiteral",
10951
+ "destinationRaw",
10952
+ "phrasing",
10953
+ "titleApostrophe",
10954
+ "titleQuote"
10955
+ ]
10956
+ },
10559
10957
  { character: "'", inConstruct: "titleApostrophe" },
10560
10958
  { character: "(", inConstruct: "destinationRaw" },
10561
10959
  {
@@ -10627,334 +11025,7 @@ function compilePattern(pattern) {
10627
11025
  pattern._compiled = new RegExp((pattern.beforeNode ? "^" : before ? "(" + before + ")" : "") + (/[$()*+.?[\\\]^{|}]/.test(pattern.character) ? "\\" : "") + pattern.character + (pattern.afterNode ? "$" : pattern.after ? "(?:" + pattern.after + ")" : ""), pattern.unicode ? "gu" : "g");
10628
11026
  }
10629
11027
  return pattern._compiled;
10630
- }
10631
-
10632
- // ../../node_modules/mdast-util-to-markdown/lib/util/character.js
10633
- function firstCharacter(value) {
10634
- const code = value.codePointAt(0);
10635
- return code === undefined ? "" : String.fromCodePoint(code);
10636
- }
10637
- function lastCharacter(value) {
10638
- const code = value.codePointAt(value.length - 2);
10639
- return code !== undefined && code > 65535 ? value.slice(-2) : value.slice(-1);
10640
- }
10641
-
10642
- // ../../node_modules/mdast-util-to-markdown/lib/util/encode-info.js
10643
- function encodeInfo(outside, inside, marker) {
10644
- const outsideKind = classifyCharacter(outside);
10645
- const insideKind = classifyCharacter(inside);
10646
- if (outsideKind === undefined) {
10647
- return insideKind === undefined ? marker === "_" ? { inside: true, outside: true } : { inside: false, outside: false } : insideKind === 1 ? { inside: true, outside: true } : { inside: false, outside: true };
10648
- }
10649
- if (outsideKind === 1) {
10650
- return insideKind === undefined ? { inside: false, outside: false } : insideKind === 1 ? { inside: true, outside: true } : { inside: false, outside: false };
10651
- }
10652
- return insideKind === undefined ? { inside: false, outside: false } : insideKind === 1 ? { inside: true, outside: false } : { inside: false, outside: false };
10653
- }
10654
- var init_encode_info = __esm(() => {
10655
- init_dev6();
10656
- });
10657
-
10658
- // ../../node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
10659
- function candidates(tokens, involved, runOf) {
10660
- const related = new Set;
10661
- for (const token of tokens) {
10662
- const siblings = runOf.get(token);
10663
- if (siblings && token.attention && involved.some((d) => d.attention === token.attention)) {
10664
- for (const sibling of siblings.tokens) {
10665
- related.add(sibling.attention);
10666
- }
10667
- }
10668
- }
10669
- const ordered = [];
10670
- for (const token of tokens) {
10671
- if (token.attention && related.delete(token.attention)) {
10672
- ordered.push(token.attention);
10673
- }
10674
- }
10675
- ordered.reverse();
10676
- return ordered;
10677
- }
10678
- function check(tokens, before, after) {
10679
- const runs = [];
10680
- const wrong = new Map;
10681
- const runOf = new Map;
10682
- let index = 0;
10683
- while (index < tokens.length) {
10684
- if (!tokens[index].attention) {
10685
- index++;
10686
- continue;
10687
- }
10688
- const marker = tokens[index].value.charAt(0);
10689
- const strict = builtins.get(marker);
10690
- let end = index + 1;
10691
- while (end < tokens.length && tokens[end].attention && tokens[end].value.charAt(0) === marker) {
10692
- end++;
10693
- }
10694
- const head = index ? tokens[index - 1].value : before;
10695
- const previous = classifyCharacter(head.charCodeAt(head.length - 1));
10696
- const next = classifyCharacter((end < tokens.length ? tokens[end].value : after).charCodeAt(0));
10697
- const open = !next || next === 2 && Boolean(previous);
10698
- const close = !previous || previous === 2 && Boolean(next);
10699
- const run = {
10700
- tokens: tokens.slice(index, end),
10701
- markers: [],
10702
- start: 0,
10703
- end: 0,
10704
- open: strict ? open && (Boolean(previous) || !close) : open,
10705
- close: strict ? close && (Boolean(next) || !open) : close,
10706
- split: strict !== undefined
10707
- };
10708
- for (const token of run.tokens) {
10709
- wrong.set(token, [...run.tokens]);
10710
- runOf.set(token, run);
10711
- let size = token.value.length;
10712
- while (size--)
10713
- run.markers.push(token);
10714
- }
10715
- run.end = run.markers.length;
10716
- runs.push(run);
10717
- index = end;
10718
- }
10719
- pair(runs, wrong);
10720
- index = -1;
10721
- while (++index < tokens.length) {
10722
- const involved = wrong.get(tokens[index]);
10723
- if (involved)
10724
- return { attention: candidates(tokens, involved, runOf), index };
10725
- }
10726
- }
10727
- function containerPhrasing(parent, state, info) {
10728
- return serialize(phrasing2(parent, state, info), info.before, info.after);
10729
- }
10730
- function encode(tokens, start) {
10731
- const token = tokens[start ? 0 : tokens.length - 1];
10732
- if (!token || token.attention)
10733
- return;
10734
- const character = start ? firstCharacter(token.value) : lastCharacter(token.value);
10735
- const reference = encodeCharacterReference(character.codePointAt(0));
10736
- token.value = start ? reference + token.value.slice(character.length) : token.value.slice(0, token.value.length - character.length) + reference;
10737
- }
10738
- function improve(items, chosen, mistake, before, after) {
10739
- for (const attention of mistake.attention) {
10740
- const current = chosen.get(attention) || attention.sequences[0];
10741
- for (const sequence of attention.sequences) {
10742
- if (sequence === current)
10743
- continue;
10744
- const trial = new Map(chosen);
10745
- trial.set(attention, sequence);
10746
- const tokens = render(items, trial, before, after);
10747
- const next = check(tokens, before, after);
10748
- if (!next || next.index > mistake.index) {
10749
- return { chosen: trial, mistake: next, tokens };
10750
- }
10751
- }
10752
- }
10753
- }
10754
- function pair(runs, wrong) {
10755
- let index = 0;
10756
- while (index < runs.length) {
10757
- const closer = runs[index];
10758
- const marker = closer.tokens[0].value.charAt(0);
10759
- const closerSize = closer.end - closer.start;
10760
- let open = closer.close && closerSize ? index : 0;
10761
- while (open--) {
10762
- const opener = runs[open];
10763
- const openerSize = opener.end - opener.start;
10764
- if (opener.tokens[0].value.charAt(0) === marker && opener.open && openerSize && (closer.split ? !((opener.close || closer.open) && closerSize % 3) || (openerSize + closerSize) % 3 : openerSize === opener.markers.length && openerSize === closerSize)) {
10765
- const size = closer.split ? openerSize > 1 && closerSize > 1 ? 2 : 1 : closerSize;
10766
- const opening = opener.markers.slice(opener.end - size, opener.end);
10767
- const closing = closer.markers.slice(closer.start, closer.start + size);
10768
- const openToken = opening[0];
10769
- const closeToken = closing[0];
10770
- if (openToken === opening[size - 1] && openToken.value.length === size && closeToken === closing[size - 1] && closeToken.value.length === size && openToken.attention === closeToken.attention) {
10771
- wrong.delete(openToken);
10772
- wrong.delete(closeToken);
10773
- } else {
10774
- const involved = [...new Set([...opening, ...closing])];
10775
- for (const token of involved) {
10776
- const list = wrong.get(token);
10777
- if (list)
10778
- list.push(...involved);
10779
- }
10780
- }
10781
- opener.end -= size;
10782
- closer.start += size;
10783
- break;
10784
- }
10785
- }
10786
- if (open === -1 || closer.start === closer.end)
10787
- index++;
10788
- }
10789
- }
10790
- function attentionSequences(type, markers, sizes) {
10791
- if (markers.length === 0) {
10792
- throw new Error("Cannot serialize `" + type + "` as attention without markers, expected one or more markers");
10793
- }
10794
- if (sizes.length === 0) {
10795
- throw new Error("Cannot serialize `" + type + "` as attention without sizes, expected one or more sizes");
10796
- }
10797
- for (const size of sizes) {
10798
- if (!Number.isSafeInteger(size) || size < 1) {
10799
- throw new Error("Cannot serialize `" + type + "` as attention with `" + size + "` as size, expected positive integer");
10800
- }
10801
- }
10802
- const sequences = [];
10803
- for (const marker of markers) {
10804
- if (marker.length !== 1) {
10805
- throw new Error("Cannot serialize `" + type + "` as attention with `" + marker + "` as marker, expected a single ascii character");
10806
- }
10807
- if (!asciiPunctuation(marker.charCodeAt(0))) {
10808
- throw new Error("Cannot serialize `" + type + "` as attention with `" + marker + "` as marker, expected ascii punctuation");
10809
- }
10810
- for (const size of sizes) {
10811
- sequences.push(marker.repeat(size));
10812
- }
10813
- }
10814
- return sequences;
10815
- }
10816
- function phrasing2(parent, state, info) {
10817
- const indexStack = state.indexStack;
10818
- const children = parent.children || [];
10819
- const results = [];
10820
- let index = -1;
10821
- let before = info.before;
10822
- indexStack.push(-1);
10823
- let tracker = state.createTracker(info);
10824
- while (++index < children.length) {
10825
- const child = children[index];
10826
- let after;
10827
- indexStack[indexStack.length - 1] = index;
10828
- if (index + 1 < children.length) {
10829
- let handle = state.handle.handlers[children[index + 1].type];
10830
- if (handle && handle.peek)
10831
- handle = handle.peek;
10832
- after = handle ? firstCharacter(handle(children[index + 1], parent, state, {
10833
- before: "",
10834
- after: "",
10835
- ...tracker.current()
10836
- })) : "";
10837
- } else {
10838
- after = info.after;
10839
- }
10840
- const previous = results[results.length - 1];
10841
- if (typeof previous === "string" && (before === "\r" || before === `
10842
- `) && child.type === "html" && htmlKind(child.value) !== 7) {
10843
- results[results.length - 1] = previous.replace(/(\r?\n|\r)$/, " ");
10844
- before = " ";
10845
- tracker = state.createTracker(info);
10846
- tracker.move(serialize(results, info.before, info.after));
10847
- }
10848
- const handle = state.handle.handlers[child.type];
10849
- if (handle && handle.attention) {
10850
- const { construct, markers, sizes } = handle.attention(child, state);
10851
- const sequences = attentionSequences(child.type, markers, sizes);
10852
- const sequence = sequences[0];
10853
- const exit = state.enter(construct);
10854
- tracker.move(sequence);
10855
- const inside = phrasing2(child, state, {
10856
- ...tracker.current(),
10857
- before: sequence,
10858
- after: sequence
10859
- });
10860
- tracker.move(serialize(inside, sequence, sequence));
10861
- tracker.move(sequence);
10862
- exit();
10863
- results.push({ children: inside, sequences });
10864
- before = sequence.charAt(sequence.length - 1);
10865
- } else {
10866
- const value = state.handle(child, parent, state, {
10867
- ...tracker.current(),
10868
- after,
10869
- before
10870
- });
10871
- if (!value)
10872
- continue;
10873
- tracker.move(value);
10874
- results.push(value);
10875
- before = lastCharacter(value);
10876
- }
10877
- }
10878
- indexStack.pop();
10879
- return results;
10880
- }
10881
- function render(items, chosen, before, after) {
10882
- const tokens = [];
10883
- let encodeAfter;
10884
- let previous = lastCharacter(before);
10885
- let index = -1;
10886
- while (++index < items.length) {
10887
- const item = items[index];
10888
- if (typeof item === "string") {
10889
- const token = { value: item, attention: undefined };
10890
- if (encodeAfter && encodeAfter === firstCharacter(item)) {
10891
- encode([token], true);
10892
- }
10893
- encodeAfter = undefined;
10894
- tokens.push(token);
10895
- if (token.value)
10896
- previous = lastCharacter(token.value);
10897
- continue;
10898
- }
10899
- const sequence = chosen.get(item) || item.sequences[0];
10900
- const marker = sequence.charAt(0);
10901
- const next = items[index + 1];
10902
- const outsideBefore = previous;
10903
- const outsideAfter = firstCharacter(next === undefined ? after : typeof next === "string" ? next : chosen.get(next) || next.sequences[0]);
10904
- const inside = render(item.children, chosen, sequence, sequence);
10905
- const head = inside.length > 0 ? inside[0].value : "";
10906
- const open = encodeInfo(outsideBefore.charCodeAt(outsideBefore.length - 1), head.charCodeAt(0), marker);
10907
- if (open.inside)
10908
- encode(inside, true);
10909
- const tail = inside.length > 0 ? lastCharacter(inside[inside.length - 1].value) : "";
10910
- const close = encodeInfo(outsideAfter.charCodeAt(0), tail.charCodeAt(tail.length - 1), marker);
10911
- if (close.inside)
10912
- encode(inside, false);
10913
- if (open.outside && outsideBefore !== `
10914
- ` && outsideBefore !== "\r") {
10915
- encode(tokens, false);
10916
- }
10917
- if (close.outside)
10918
- encodeAfter = outsideAfter;
10919
- tokens.push({ value: sequence, attention: item }, ...inside, {
10920
- value: sequence,
10921
- attention: item
10922
- });
10923
- previous = sequence.charAt(sequence.length - 1);
10924
- }
10925
- return tokens;
10926
- }
10927
- function serialize(items, before, after) {
10928
- let chosen = new Map;
10929
- const initial = render(items, chosen, before, after);
10930
- let tokens = initial;
10931
- let mistake = check(tokens, before, after);
10932
- while (mistake) {
10933
- const next = improve(items, chosen, mistake, before, after);
10934
- if (!next) {
10935
- tokens = initial;
10936
- break;
10937
- }
10938
- chosen = next.chosen;
10939
- tokens = next.tokens;
10940
- mistake = next.mistake;
10941
- }
10942
- let result = "";
10943
- for (const token of tokens)
10944
- result += token.value;
10945
- return result;
10946
- }
10947
- var builtins;
10948
- var init_container_phrasing = __esm(() => {
10949
- init_dev4();
10950
- init_dev6();
10951
- init_encode_info();
10952
- init_html_kind();
10953
- builtins = new Map([
10954
- ["*", false],
10955
- ["_", true]
10956
- ]);
10957
- });
11028
+ }
10958
11029
 
10959
11030
  // ../../node_modules/mdast-util-to-markdown/lib/util/container-flow.js
10960
11031
  function containerFlow(parent, state, info) {
@@ -11086,22 +11157,20 @@ function safe(state, input, config) {
11086
11157
  continue;
11087
11158
  }
11088
11159
  }
11089
- if (position + 1 < end && positions[index + 1] === position + 1 && infos[position].after && !infos[position + 1].before && !infos[position + 1].after || positions[index - 1] === position - 1 && infos[position].before && !infos[position - 1].before && !infos[position - 1].after) {
11160
+ if (position + 1 < end && positions[index + 1] === position + 1 && infos[position].after && !infos[position + 1].before && !infos[position + 1].after || position - 1 >= offset && positions[index - 1] === position - 1 && infos[position].before && !infos[position - 1].before && !infos[position - 1].after) {
11090
11161
  continue;
11091
11162
  }
11092
11163
  if (start !== position) {
11093
11164
  const slice = value.slice(start, position);
11094
11165
  result.push(percentEncode ? slice : escapeBackslashes(slice, "\\"));
11095
11166
  }
11096
- start = position;
11167
+ start = position + 1;
11097
11168
  if (percentEncode) {
11098
11169
  result.push("%" + value.charCodeAt(position).toString(16).toUpperCase().padStart(2, "0"));
11099
- start++;
11100
11170
  } else if (/[!-/:-@[-`{-~]/.test(value.charAt(position)) && (!config.encode || !config.encode.includes(value.charAt(position)))) {
11101
- result.push("\\");
11171
+ result.push("\\" + value.charAt(position));
11102
11172
  } else {
11103
11173
  result.push(encodeCharacterReference(value.charCodeAt(position)));
11104
- start++;
11105
11174
  }
11106
11175
  }
11107
11176
  const rest = value.slice(start, end);
@@ -12092,84 +12161,9 @@ var init_stringify_entities = __esm(() => {
12092
12161
  init_lib13();
12093
12162
  });
12094
12163
 
12095
- // ../../node_modules/mdast-util-directive/node_modules/unist-util-visit-parents/lib/color.node.js
12096
- function color2(d) {
12097
- return "\x1B[33m" + d + "\x1B[39m";
12098
- }
12099
-
12100
- // ../../node_modules/mdast-util-directive/node_modules/unist-util-visit-parents/lib/index.js
12101
- function visitParents2(tree, test, visitor, reverse) {
12102
- let check;
12103
- if (typeof test === "function" && typeof visitor !== "function") {
12104
- reverse = visitor;
12105
- visitor = test;
12106
- } else {
12107
- check = test;
12108
- }
12109
- const is = convert(check);
12110
- const step = reverse ? -1 : 1;
12111
- factory(tree, undefined, [])();
12112
- function factory(node, index, parents) {
12113
- const value = node && typeof node === "object" ? node : {};
12114
- if (typeof value.type === "string") {
12115
- const name = typeof value.tagName === "string" ? value.tagName : typeof value.name === "string" ? value.name : undefined;
12116
- Object.defineProperty(visit, "name", {
12117
- value: "node (" + color2(node.type + (name ? "<" + name + ">" : "")) + ")"
12118
- });
12119
- }
12120
- return visit;
12121
- function visit() {
12122
- let result = empty2;
12123
- let subresult;
12124
- let offset;
12125
- let grandparents;
12126
- if (!test || is(node, index, parents[parents.length - 1] || undefined)) {
12127
- result = toResult2(visitor(node, parents));
12128
- if (result[0] === EXIT2) {
12129
- return result;
12130
- }
12131
- }
12132
- if ("children" in node && node.children) {
12133
- const nodeAsParent = node;
12134
- if (nodeAsParent.children && result[0] !== SKIP2) {
12135
- offset = (reverse ? nodeAsParent.children.length : -1) + step;
12136
- grandparents = parents.concat(nodeAsParent);
12137
- while (offset > -1 && offset < nodeAsParent.children.length) {
12138
- const child = nodeAsParent.children[offset];
12139
- subresult = factory(child, offset, grandparents)();
12140
- if (subresult[0] === EXIT2) {
12141
- return subresult;
12142
- }
12143
- offset = typeof subresult[1] === "number" ? subresult[1] : offset + step;
12144
- }
12145
- }
12146
- }
12147
- return result;
12148
- }
12149
- }
12150
- }
12151
- function toResult2(value) {
12152
- if (Array.isArray(value)) {
12153
- return value;
12154
- }
12155
- if (typeof value === "number") {
12156
- return [CONTINUE2, value];
12157
- }
12158
- return value === null || value === undefined ? empty2 : [value];
12159
- }
12160
- var empty2, CONTINUE2 = true, EXIT2 = false, SKIP2 = "skip";
12161
- var init_lib14 = __esm(() => {
12162
- init_unist_util_is();
12163
- empty2 = [];
12164
- });
12165
-
12166
- // ../../node_modules/mdast-util-directive/node_modules/unist-util-visit-parents/index.js
12167
- var init_unist_util_visit_parents2 = __esm(() => {
12168
- init_lib14();
12169
- });
12170
-
12171
12164
  // ../../node_modules/mdast-util-directive/lib/index.js
12172
- function directiveFromMarkdown() {
12165
+ function directiveFromMarkdown(options) {
12166
+ const settings = options || emptyFromMarkdownOptions;
12173
12167
  return {
12174
12168
  canContainEols: ["textDirective"],
12175
12169
  enter: {
@@ -12183,29 +12177,57 @@ function directiveFromMarkdown() {
12183
12177
  },
12184
12178
  exit: {
12185
12179
  directiveContainer: exit2,
12180
+ directiveContainerAttributeClass: exitAttributeShortcut,
12186
12181
  directiveContainerAttributeClassValue: exitAttributeClassValue,
12182
+ directiveContainerAttributeId: exitAttributeShortcut,
12187
12183
  directiveContainerAttributeIdValue: exitAttributeIdValue,
12188
12184
  directiveContainerAttributeName: exitAttributeName,
12189
12185
  directiveContainerAttributeValue: exitAttributeValue,
12186
+ directiveContainerAttributeValueLiteral: exitAttributeValueLiteral,
12190
12187
  directiveContainerAttributes: exitAttributes,
12191
12188
  directiveContainerLabel: exitContainerLabel,
12192
12189
  directiveContainerName: exitName,
12190
+ directiveContainerSequence: exitSequence,
12193
12191
  directiveLeaf: exit2,
12192
+ directiveLeafAttributeClass: exitAttributeShortcut,
12194
12193
  directiveLeafAttributeClassValue: exitAttributeClassValue,
12194
+ directiveLeafAttributeId: exitAttributeShortcut,
12195
12195
  directiveLeafAttributeIdValue: exitAttributeIdValue,
12196
12196
  directiveLeafAttributeName: exitAttributeName,
12197
12197
  directiveLeafAttributeValue: exitAttributeValue,
12198
+ directiveLeafAttributeValueLiteral: exitAttributeValueLiteral,
12198
12199
  directiveLeafAttributes: exitAttributes,
12200
+ directiveLeafLabel: exitLabel,
12199
12201
  directiveLeafName: exitName,
12202
+ directiveLeafSequence: exitSequence,
12200
12203
  directiveText: exit2,
12204
+ directiveTextAttributeClass: exitAttributeShortcut,
12201
12205
  directiveTextAttributeClassValue: exitAttributeClassValue,
12206
+ directiveTextAttributeId: exitAttributeShortcut,
12202
12207
  directiveTextAttributeIdValue: exitAttributeIdValue,
12203
12208
  directiveTextAttributeName: exitAttributeName,
12204
12209
  directiveTextAttributeValue: exitAttributeValue,
12210
+ directiveTextAttributeValueLiteral: exitAttributeValueLiteral,
12205
12211
  directiveTextAttributes: exitAttributes,
12212
+ directiveTextLabel: exitLabel,
12213
+ directiveTextMarker: exitSequence,
12206
12214
  directiveTextName: exitName
12207
12215
  }
12208
12216
  };
12217
+ function exitSequence(token) {
12218
+ if (!settings.verbose)
12219
+ return;
12220
+ const node = this.stack[this.stack.length - 1];
12221
+ ok(node, "expected `node`");
12222
+ ok(node.type === "containerDirective" || node.type === "leafDirective" || node.type === "textDirective");
12223
+ const place = { start: point3(token.start), end: point3(token.end) };
12224
+ if (node.data && node.data.position) {
12225
+ ok(node.type === "containerDirective");
12226
+ node.data.position.closing = place;
12227
+ } else {
12228
+ node.data = { position: { opening: place } };
12229
+ }
12230
+ }
12209
12231
  }
12210
12232
  function directiveToMarkdown(options) {
12211
12233
  const settings = options || emptyOptions2;
@@ -12242,8 +12264,20 @@ function directiveToMarkdown(options) {
12242
12264
  };
12243
12265
  function handleDirective(node, _, state, info) {
12244
12266
  const tracker = state.createTracker(info);
12245
- const sequence = fence(node);
12246
12267
  const exit = state.enter(node.type);
12268
+ let content;
12269
+ if (node.type === "containerDirective") {
12270
+ const head = (node.children || [])[0];
12271
+ const children = inlineDirectiveLabel(head) ? node.children.slice(1) : node.children;
12272
+ if (children && children.length > 0) {
12273
+ const current = tracker.current();
12274
+ content = state.containerFlow({ ...node, children }, {
12275
+ now: { line: current.now.line + 1, column: 1 + current.lineShift },
12276
+ lineShift: current.lineShift
12277
+ });
12278
+ }
12279
+ }
12280
+ const sequence = fence(node, content ? longestColonLine(content) : 0);
12247
12281
  let value = tracker.move(sequence + (node.name || ""));
12248
12282
  const attributesValue = attributes(node, state);
12249
12283
  const after = info.after.charCodeAt(0);
@@ -12272,15 +12306,9 @@ function directiveToMarkdown(options) {
12272
12306
  }
12273
12307
  value += tracker.move(attributesValue || (after === 123 ? "{}" : ""));
12274
12308
  if (node.type === "containerDirective") {
12275
- const head = (node.children || [])[0];
12276
- let shallow = node;
12277
- if (inlineDirectiveLabel(head)) {
12278
- shallow = Object.assign({}, node, { children: node.children.slice(1) });
12279
- }
12280
- if (shallow && shallow.children && shallow.children.length > 0) {
12309
+ if (content) {
12281
12310
  value += tracker.move(`
12282
- `);
12283
- value += tracker.move(state.containerFlow(shallow, tracker.current()));
12311
+ ` + content);
12284
12312
  }
12285
12313
  value += tracker.move(`
12286
12314
  ` + sequence);
@@ -12297,16 +12325,15 @@ function directiveToMarkdown(options) {
12297
12325
  let key;
12298
12326
  for (key in attributes) {
12299
12327
  if (own8.call(attributes, key) && attributes[key] !== undefined && attributes[key] !== null) {
12300
- const value = String(attributes[key]);
12328
+ const value = encode2(String(attributes[key]));
12301
12329
  if (key === "id") {
12302
12330
  id = settings.preferShortcut !== false && shortcut.test(value) ? "#" + value : quoted("id", value, node, state);
12303
12331
  } else if (key === "class") {
12304
12332
  const list = value.split(/[\t\n\r ]+/);
12305
12333
  const classesFullList = [];
12306
12334
  const classesList = [];
12307
- let index = -1;
12308
- while (++index < list.length) {
12309
- (settings.preferShortcut !== false && shortcut.test(list[index]) ? classesList : classesFullList).push(list[index]);
12335
+ for (const item of list) {
12336
+ (settings.preferShortcut !== false && shortcut.test(item) ? classesList : classesFullList).push(item);
12310
12337
  }
12311
12338
  classesFull = classesFullList.length > 0 ? quoted("class", classesFullList.join(" "), node, state) : "";
12312
12339
  classes = classesList.length > 0 ? "." + classesList.join(".") : "";
@@ -12354,19 +12381,50 @@ function enter(type, token) {
12354
12381
  }
12355
12382
  function exitName(token) {
12356
12383
  const node = this.stack[this.stack.length - 1];
12384
+ ok(node, "expected `node`");
12357
12385
  ok(node.type === "containerDirective" || node.type === "leafDirective" || node.type === "textDirective");
12358
12386
  node.name = this.sliceSerialize(token);
12387
+ openingEnd(node, token);
12359
12388
  }
12360
12389
  function enterContainerLabel(token) {
12361
12390
  this.enter({ type: "paragraph", data: { directiveLabel: true }, children: [] }, token);
12362
12391
  }
12363
12392
  function exitContainerLabel(token) {
12364
12393
  this.exit(token);
12394
+ const node = this.stack[this.stack.length - 1];
12395
+ ok(node, "expected `node`");
12396
+ ok(node.type === "containerDirective");
12397
+ openingEnd(node, token);
12398
+ }
12399
+ function exitLabel(token) {
12400
+ const node = this.stack[this.stack.length - 1];
12401
+ ok(node, "expected `node`");
12402
+ ok(node.type === "leafDirective" || node.type === "textDirective");
12403
+ openingEnd(node, token);
12365
12404
  }
12366
12405
  function enterAttributes() {
12406
+ const node = this.stack[this.stack.length - 1];
12407
+ ok(node, "expected `node`");
12408
+ ok(node.type === "containerDirective" || node.type === "leafDirective" || node.type === "textDirective");
12409
+ if (node.data && node.data.position) {
12410
+ this.data.directiveAttributePositions = {};
12411
+ }
12367
12412
  this.data.directiveAttributes = [];
12368
12413
  this.buffer();
12369
12414
  }
12415
+ function exitAttributeShortcut(token) {
12416
+ const positions = this.data.directiveAttributePositions;
12417
+ if (positions) {
12418
+ const list = this.data.directiveAttributes;
12419
+ ok(list, "expected `directiveAttributes`");
12420
+ const tail = list[list.length - 1];
12421
+ ok(tail, "expected attribute");
12422
+ positions[tail[0]] = { start: point3(token.start), end: point3(token.end) };
12423
+ }
12424
+ }
12425
+ function exitAttributeValueLiteral(token) {
12426
+ attributeEnd(this, token);
12427
+ }
12370
12428
  function exitAttributeIdValue(token) {
12371
12429
  const list = this.data.directiveAttributes;
12372
12430
  ok(list, "expected `directiveAttributes`");
@@ -12386,33 +12444,67 @@ function exitAttributeClassValue(token) {
12386
12444
  function exitAttributeValue(token) {
12387
12445
  const list = this.data.directiveAttributes;
12388
12446
  ok(list, "expected `directiveAttributes`");
12389
- list[list.length - 1][1] = parseEntities(this.sliceSerialize(token), {
12390
- attribute: true
12391
- });
12447
+ const tail = list[list.length - 1];
12448
+ ok(tail, "expected attribute");
12449
+ tail[1] = parseEntities(this.sliceSerialize(token), { attribute: true });
12450
+ attributeEnd(this, token);
12392
12451
  }
12393
12452
  function exitAttributeName(token) {
12394
12453
  const list = this.data.directiveAttributes;
12395
12454
  ok(list, "expected `directiveAttributes`");
12396
- list.push([this.sliceSerialize(token), ""]);
12455
+ const name = this.sliceSerialize(token);
12456
+ list.push([name, ""]);
12457
+ const positions = this.data.directiveAttributePositions;
12458
+ if (positions) {
12459
+ positions[name] = { start: point3(token.start), end: point3(token.end) };
12460
+ }
12397
12461
  }
12398
- function exitAttributes() {
12462
+ function exitAttributes(token) {
12399
12463
  const list = this.data.directiveAttributes;
12400
12464
  ok(list, "expected `directiveAttributes`");
12401
12465
  const cleaned = {};
12402
- let index = -1;
12403
- while (++index < list.length) {
12404
- const attribute = list[index];
12466
+ for (const attribute of list) {
12405
12467
  if (attribute[0] === "class" && cleaned.class) {
12406
12468
  cleaned.class += " " + attribute[1];
12407
12469
  } else {
12408
12470
  cleaned[attribute[0]] = attribute[1];
12409
12471
  }
12410
12472
  }
12473
+ const positions = this.data.directiveAttributePositions;
12474
+ this.data.directiveAttributePositions = undefined;
12411
12475
  this.data.directiveAttributes = undefined;
12412
12476
  this.resume();
12413
12477
  const node = this.stack[this.stack.length - 1];
12478
+ ok(node, "expected `node`");
12414
12479
  ok(node.type === "containerDirective" || node.type === "leafDirective" || node.type === "textDirective");
12415
12480
  node.attributes = cleaned;
12481
+ if (positions) {
12482
+ ok(node.data && node.data.position, "expected `position`");
12483
+ node.data.position.attributes = positions;
12484
+ }
12485
+ openingEnd(node, token);
12486
+ }
12487
+ function openingEnd(node, token) {
12488
+ if (node.data && node.data.position) {
12489
+ const { opening } = node.data.position;
12490
+ ok(opening, "expected `opening`");
12491
+ opening.end = point3(token.end);
12492
+ }
12493
+ }
12494
+ function attributeEnd(context, token) {
12495
+ const positions = context.data.directiveAttributePositions;
12496
+ if (positions) {
12497
+ const list = context.data.directiveAttributes;
12498
+ ok(list, "expected `directiveAttributes`");
12499
+ const tail = list[list.length - 1];
12500
+ ok(tail, "expected attribute");
12501
+ const position = positions[tail[0]];
12502
+ ok(position, "expected position");
12503
+ position.end = point3(token.end);
12504
+ }
12505
+ }
12506
+ function point3(d) {
12507
+ return { line: d.line, column: d.column, offset: d.offset };
12416
12508
  }
12417
12509
  function exit2(token) {
12418
12510
  this.exit(token);
@@ -12420,26 +12512,28 @@ function exit2(token) {
12420
12512
  function peekDirective() {
12421
12513
  return ":";
12422
12514
  }
12515
+ function encode2(value) {
12516
+ const result = [];
12517
+ let start = 0;
12518
+ let index = value.indexOf("&");
12519
+ while (index !== -1) {
12520
+ const code = value.charCodeAt(index + 1);
12521
+ if (code === 35 || asciiAlpha(code)) {
12522
+ result.push(value.slice(start, index), "&#x26;");
12523
+ start = index + 1;
12524
+ }
12525
+ index = value.indexOf("&", index + 1);
12526
+ }
12527
+ result.push(value.slice(start));
12528
+ return result.join("");
12529
+ }
12423
12530
  function inlineDirectiveLabel(node) {
12424
12531
  return Boolean(node && node.type === "paragraph" && node.data && node.data.directiveLabel);
12425
12532
  }
12426
- function fence(node) {
12533
+ function fence(node, longest) {
12427
12534
  let size = 0;
12428
12535
  if (node.type === "containerDirective") {
12429
- visitParents2(node, function(node, parents) {
12430
- if (node.type === "containerDirective") {
12431
- let index = parents.length;
12432
- let nesting = 0;
12433
- while (index--) {
12434
- if (parents[index].type === "containerDirective") {
12435
- nesting++;
12436
- }
12437
- }
12438
- if (nesting > size)
12439
- size = nesting;
12440
- }
12441
- });
12442
- size += 3;
12536
+ size = Math.max(3, longest + 1);
12443
12537
  } else if (node.type === "leafDirective") {
12444
12538
  size = 2;
12445
12539
  } else {
@@ -12447,14 +12541,40 @@ function fence(node) {
12447
12541
  }
12448
12542
  return ":".repeat(size);
12449
12543
  }
12450
- var own8, emptyOptions2, shortcut, unquoted;
12451
- var init_lib15 = __esm(() => {
12544
+ function longestColonLine(value) {
12545
+ let longest = 0;
12546
+ let index = 0;
12547
+ while (index < value.length) {
12548
+ let size = 0;
12549
+ let code = value.charCodeAt(index);
12550
+ while (code === 9 || code === 32) {
12551
+ code = value.charCodeAt(++index);
12552
+ }
12553
+ while (code === 58) {
12554
+ size++;
12555
+ code = value.charCodeAt(++index);
12556
+ }
12557
+ while (code === 9 || code === 32) {
12558
+ code = value.charCodeAt(++index);
12559
+ }
12560
+ while (!(code === 10 || code === 13 || Number.isNaN(code))) {
12561
+ size = 0;
12562
+ code = value.charCodeAt(++index);
12563
+ }
12564
+ if (size > longest)
12565
+ longest = size;
12566
+ index++;
12567
+ }
12568
+ return longest;
12569
+ }
12570
+ var own8, emptyFromMarkdownOptions, emptyOptions2, shortcut, unquoted;
12571
+ var init_lib14 = __esm(() => {
12452
12572
  init_development();
12453
12573
  init_dev4();
12454
12574
  init_parse_entities();
12455
12575
  init_stringify_entities();
12456
- init_unist_util_visit_parents2();
12457
12576
  own8 = {}.hasOwnProperty;
12577
+ emptyFromMarkdownOptions = {};
12458
12578
  emptyOptions2 = {};
12459
12579
  shortcut = /^[^\t\n\r "#'.<=>`}]+$/;
12460
12580
  unquoted = /^[^\t\n\r "'<=>`}]+$/;
@@ -12462,7 +12582,7 @@ var init_lib15 = __esm(() => {
12462
12582
 
12463
12583
  // ../../node_modules/mdast-util-directive/index.js
12464
12584
  var init_mdast_util_directive = __esm(() => {
12465
- init_lib15();
12585
+ init_lib14();
12466
12586
  });
12467
12587
 
12468
12588
  // ../../node_modules/micromark-extension-directive/dev/lib/factory-attributes.js
@@ -13078,14 +13198,14 @@ function remarkDirective() {
13078
13198
  fromMarkdownExtensions.push(directiveFromMarkdown());
13079
13199
  toMarkdownExtensions.push(directiveToMarkdown());
13080
13200
  }
13081
- var init_lib16 = __esm(() => {
13201
+ var init_lib15 = __esm(() => {
13082
13202
  init_mdast_util_directive();
13083
13203
  init_dev16();
13084
13204
  });
13085
13205
 
13086
13206
  // ../../node_modules/remark-directive/index.js
13087
13207
  var init_remark_directive = __esm(() => {
13088
- init_lib16();
13208
+ init_lib15();
13089
13209
  });
13090
13210
 
13091
13211
  // ../../node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js
@@ -13097,79 +13217,113 @@ function escapeStringRegexp(string) {
13097
13217
  }
13098
13218
 
13099
13219
  // ../../node_modules/mdast-util-find-and-replace/node_modules/unist-util-visit-parents/lib/color.node.js
13100
- function color3(d) {
13220
+ function color2(d) {
13101
13221
  return "\x1B[33m" + d + "\x1B[39m";
13102
13222
  }
13103
13223
 
13104
13224
  // ../../node_modules/mdast-util-find-and-replace/node_modules/unist-util-visit-parents/lib/index.js
13105
- function visitParents3(tree, test, visitor, reverse) {
13225
+ function visitParents2(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, reverse) {
13226
+ if (!tree || typeof tree !== "object") {
13227
+ throw new Error("Unexpected value `" + tree + "` for `tree`, expected node");
13228
+ }
13229
+ let preorder = true;
13106
13230
  let check;
13107
- if (typeof test === "function" && typeof visitor !== "function") {
13108
- reverse = visitor;
13109
- visitor = test;
13231
+ let visitors;
13232
+ let enter;
13233
+ let exit;
13234
+ if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
13235
+ check = testOrEnterOrVisitors;
13236
+ visitors = enterOrVisitorsOrReverse;
13237
+ if (reverse)
13238
+ preorder = false;
13239
+ } else {
13240
+ visitors = testOrEnterOrVisitors;
13241
+ if (enterOrVisitorsOrReverse)
13242
+ preorder = false;
13243
+ }
13244
+ if (typeof visitors === "function") {
13245
+ enter = visitors;
13246
+ } else if (visitors && typeof visitors === "object") {
13247
+ if (visitors.enter === null || visitors.enter === undefined) {} else if (typeof visitors.enter === "function") {
13248
+ enter = visitors.enter;
13249
+ } else {
13250
+ throw new Error("Unexpected value `" + visitors.enter + "` for `visitors.enter`, expected optional visitor");
13251
+ }
13252
+ if (typeof visitors.exit === "function") {
13253
+ exit = visitors.exit;
13254
+ } else {
13255
+ throw new Error("Unexpected value `" + visitors.exit + "` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)");
13256
+ }
13110
13257
  } else {
13111
- check = test;
13258
+ throw new Error("Unexpected value `" + visitors + "` for `enter` or `visitors`, expected visitor or object with visitors");
13112
13259
  }
13113
13260
  const is = convert(check);
13114
- const step = reverse ? -1 : 1;
13261
+ const step = preorder ? 1 : -1;
13115
13262
  factory(tree, undefined, [])();
13116
13263
  function factory(node, index, parents) {
13117
13264
  const value = node && typeof node === "object" ? node : {};
13118
13265
  if (typeof value.type === "string") {
13119
13266
  const name = typeof value.tagName === "string" ? value.tagName : typeof value.name === "string" ? value.name : undefined;
13120
13267
  Object.defineProperty(visit, "name", {
13121
- value: "node (" + color3(node.type + (name ? "<" + name + ">" : "")) + ")"
13268
+ value: "node (" + color2(node.type + (name ? "<" + name + ">" : "")) + ")"
13122
13269
  });
13123
13270
  }
13124
13271
  return visit;
13125
13272
  function visit() {
13126
- let result = empty3;
13127
- let subresult;
13128
- let offset;
13129
- let grandparents;
13130
- if (!test || is(node, index, parents[parents.length - 1] || undefined)) {
13131
- result = toResult3(visitor(node, parents));
13132
- if (result[0] === EXIT3) {
13273
+ const matches = !check || is(node, index, parents[parents.length - 1] || undefined);
13274
+ let result = empty2;
13275
+ if (enter && matches) {
13276
+ result = toResult2(enter(node, parents, index));
13277
+ if (result[0] === EXIT2) {
13133
13278
  return result;
13134
13279
  }
13135
13280
  }
13136
13281
  if ("children" in node && node.children) {
13137
13282
  const nodeAsParent = node;
13138
- if (nodeAsParent.children && result[0] !== SKIP3) {
13139
- offset = (reverse ? nodeAsParent.children.length : -1) + step;
13140
- grandparents = parents.concat(nodeAsParent);
13283
+ if (nodeAsParent.children && result[0] !== SKIP2) {
13284
+ let offset = (preorder ? -1 : nodeAsParent.children.length) + step;
13285
+ const grandparents = [...parents, nodeAsParent];
13141
13286
  while (offset > -1 && offset < nodeAsParent.children.length) {
13142
13287
  const child = nodeAsParent.children[offset];
13143
- subresult = factory(child, offset, grandparents)();
13144
- if (subresult[0] === EXIT3) {
13288
+ const subresult = factory(child, offset, grandparents)();
13289
+ if (subresult[0] === EXIT2) {
13145
13290
  return subresult;
13146
13291
  }
13147
13292
  offset = typeof subresult[1] === "number" ? subresult[1] : offset + step;
13148
13293
  }
13149
13294
  }
13150
13295
  }
13296
+ if (exit && matches) {
13297
+ const exitResult = toResult2(exit(node, parents, index));
13298
+ if (exitResult[0] === SKIP2) {
13299
+ throw new Error("Unexpected value `" + exitResult[0] + "` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");
13300
+ }
13301
+ if (exitResult[0] === EXIT2 || typeof exitResult[1] === "number") {
13302
+ return exitResult;
13303
+ }
13304
+ }
13151
13305
  return result;
13152
13306
  }
13153
13307
  }
13154
13308
  }
13155
- function toResult3(value) {
13309
+ function toResult2(value) {
13156
13310
  if (Array.isArray(value)) {
13157
13311
  return value;
13158
13312
  }
13159
13313
  if (typeof value === "number") {
13160
- return [CONTINUE3, value];
13314
+ return [CONTINUE2, value];
13161
13315
  }
13162
- return value === null || value === undefined ? empty3 : [value];
13316
+ return value === null || value === undefined ? empty2 : [value];
13163
13317
  }
13164
- var empty3, CONTINUE3 = true, EXIT3 = false, SKIP3 = "skip";
13165
- var init_lib17 = __esm(() => {
13318
+ var empty2, CONTINUE2 = true, EXIT2 = false, SKIP2 = "skip";
13319
+ var init_lib16 = __esm(() => {
13166
13320
  init_unist_util_is();
13167
- empty3 = [];
13321
+ empty2 = [];
13168
13322
  });
13169
13323
 
13170
13324
  // ../../node_modules/mdast-util-find-and-replace/node_modules/unist-util-visit-parents/index.js
13171
- var init_unist_util_visit_parents3 = __esm(() => {
13172
- init_lib17();
13325
+ var init_unist_util_visit_parents2 = __esm(() => {
13326
+ init_lib16();
13173
13327
  });
13174
13328
 
13175
13329
  // ../../node_modules/mdast-util-find-and-replace/lib/index.js
@@ -13179,30 +13333,20 @@ function findAndReplace(tree, list, options) {
13179
13333
  const pairs = toPairs(list);
13180
13334
  let pairIndex = -1;
13181
13335
  while (++pairIndex < pairs.length) {
13182
- visitParents3(tree, "text", visitor);
13336
+ visitParents2(tree, visitor);
13183
13337
  }
13184
- function visitor(node, parents) {
13185
- let index = -1;
13186
- let grandparent;
13187
- while (++index < parents.length) {
13188
- const parent = parents[index];
13189
- const siblings = grandparent ? grandparent.children : undefined;
13190
- if (ignored(parent, siblings ? siblings.indexOf(parent) : undefined, grandparent)) {
13191
- return;
13192
- }
13193
- grandparent = parent;
13194
- }
13195
- if (grandparent) {
13196
- return handler(node, parents);
13338
+ function visitor(node, parents, index) {
13339
+ if (node.type === "text" && typeof index === "number") {
13340
+ return handler(node, parents, index);
13197
13341
  }
13342
+ if (ignored(node, index, parents[parents.length - 1]))
13343
+ return SKIP2;
13198
13344
  }
13199
- function handler(node, parents) {
13345
+ function handler(node, parents, index) {
13200
13346
  const parent = parents[parents.length - 1];
13201
13347
  const find = pairs[pairIndex][0];
13202
13348
  const replace = pairs[pairIndex][1];
13203
13349
  let start = 0;
13204
- const siblings = parent.children;
13205
- const index = siblings.indexOf(node);
13206
13350
  let change = false;
13207
13351
  let nodes = [];
13208
13352
  find.lastIndex = 0;
@@ -13278,14 +13422,14 @@ function toFunction(replace) {
13278
13422
  return replace;
13279
13423
  };
13280
13424
  }
13281
- var init_lib18 = __esm(() => {
13282
- init_unist_util_visit_parents3();
13425
+ var init_lib17 = __esm(() => {
13426
+ init_unist_util_visit_parents2();
13283
13427
  init_unist_util_is();
13284
13428
  });
13285
13429
 
13286
13430
  // ../../node_modules/mdast-util-find-and-replace/index.js
13287
13431
  var init_mdast_util_find_and_replace = __esm(() => {
13288
- init_lib18();
13432
+ init_lib17();
13289
13433
  });
13290
13434
 
13291
13435
  // ../../node_modules/mdast-util-gfm-autolink-literal/lib/index.js
@@ -13428,7 +13572,7 @@ function previous3(match, email) {
13428
13572
  return (match.index === 0 || unicodeWhitespace(code) || unicodePunctuation(code)) && (!email || code !== 47);
13429
13573
  }
13430
13574
  var inConstruct = "phrasing", notInConstruct;
13431
- var init_lib19 = __esm(() => {
13575
+ var init_lib18 = __esm(() => {
13432
13576
  init_development();
13433
13577
  init_dev4();
13434
13578
  init_mdast_util_find_and_replace();
@@ -13437,7 +13581,7 @@ var init_lib19 = __esm(() => {
13437
13581
 
13438
13582
  // ../../node_modules/mdast-util-gfm-autolink-literal/index.js
13439
13583
  var init_mdast_util_gfm_autolink_literal = __esm(() => {
13440
- init_lib19();
13584
+ init_lib18();
13441
13585
  });
13442
13586
 
13443
13587
  // ../../node_modules/mdast-util-gfm-footnote/lib/index.js
@@ -13535,7 +13679,7 @@ function mapExceptFirst(line, index, blank) {
13535
13679
  function mapAll(line, index, blank) {
13536
13680
  return (blank ? "" : " ") + line;
13537
13681
  }
13538
- var init_lib20 = __esm(() => {
13682
+ var init_lib19 = __esm(() => {
13539
13683
  init_development();
13540
13684
  init_dev3();
13541
13685
  footnoteReference.peek = footnoteReferencePeek;
@@ -13543,7 +13687,7 @@ var init_lib20 = __esm(() => {
13543
13687
 
13544
13688
  // ../../node_modules/mdast-util-gfm-footnote/index.js
13545
13689
  var init_mdast_util_gfm_footnote = __esm(() => {
13546
- init_lib20();
13690
+ init_lib19();
13547
13691
  });
13548
13692
 
13549
13693
  // ../../node_modules/mdast-util-gfm-strikethrough/lib/index.js
@@ -13593,7 +13737,7 @@ function peekDelete() {
13593
13737
  return "~";
13594
13738
  }
13595
13739
  var constructsWithoutStrikethrough;
13596
- var init_lib21 = __esm(() => {
13740
+ var init_lib20 = __esm(() => {
13597
13741
  constructsWithoutStrikethrough = [
13598
13742
  "autolink",
13599
13743
  "destinationLiteral",
@@ -13608,7 +13752,7 @@ var init_lib21 = __esm(() => {
13608
13752
 
13609
13753
  // ../../node_modules/mdast-util-gfm-strikethrough/index.js
13610
13754
  var init_mdast_util_gfm_strikethrough = __esm(() => {
13611
- init_lib21();
13755
+ init_lib20();
13612
13756
  });
13613
13757
 
13614
13758
  // ../../node_modules/markdown-table/index.js
@@ -13884,14 +14028,14 @@ function gfmTableToMarkdown(options) {
13884
14028
  return value;
13885
14029
  }
13886
14030
  }
13887
- var init_lib22 = __esm(() => {
14031
+ var init_lib21 = __esm(() => {
13888
14032
  init_development();
13889
14033
  init_mdast_util_to_markdown();
13890
14034
  });
13891
14035
 
13892
14036
  // ../../node_modules/mdast-util-gfm-table/index.js
13893
14037
  var init_mdast_util_gfm_table = __esm(() => {
13894
- init_lib22();
14038
+ init_lib21();
13895
14039
  });
13896
14040
 
13897
14041
  // ../../node_modules/mdast-util-gfm-task-list-item/lib/index.js
@@ -13966,14 +14110,14 @@ function listItemWithTaskListItem(node, parent, state, info) {
13966
14110
  return $0 + checkbox;
13967
14111
  }
13968
14112
  }
13969
- var init_lib23 = __esm(() => {
14113
+ var init_lib22 = __esm(() => {
13970
14114
  init_development();
13971
14115
  init_mdast_util_to_markdown();
13972
14116
  });
13973
14117
 
13974
14118
  // ../../node_modules/mdast-util-gfm-task-list-item/index.js
13975
14119
  var init_mdast_util_gfm_task_list_item = __esm(() => {
13976
- init_lib23();
14120
+ init_lib22();
13977
14121
  });
13978
14122
 
13979
14123
  // ../../node_modules/mdast-util-gfm/lib/index.js
@@ -13997,7 +14141,7 @@ function gfmToMarkdown(options) {
13997
14141
  ]
13998
14142
  };
13999
14143
  }
14000
- var init_lib24 = __esm(() => {
14144
+ var init_lib23 = __esm(() => {
14001
14145
  init_mdast_util_gfm_autolink_literal();
14002
14146
  init_mdast_util_gfm_footnote();
14003
14147
  init_mdast_util_gfm_strikethrough();
@@ -14007,7 +14151,7 @@ var init_lib24 = __esm(() => {
14007
14151
 
14008
14152
  // ../../node_modules/mdast-util-gfm/index.js
14009
14153
  var init_mdast_util_gfm = __esm(() => {
14010
- init_lib24();
14154
+ init_lib23();
14011
14155
  });
14012
14156
 
14013
14157
  // ../../node_modules/micromark-extension-gfm-autolink-literal/dev/lib/syntax.js
@@ -15313,7 +15457,7 @@ function remarkGfm(options) {
15313
15457
  toMarkdownExtensions.push(gfmToMarkdown(settings));
15314
15458
  }
15315
15459
  var emptyOptions3;
15316
- var init_lib25 = __esm(() => {
15460
+ var init_lib24 = __esm(() => {
15317
15461
  init_mdast_util_gfm();
15318
15462
  init_micromark_extension_gfm();
15319
15463
  emptyOptions3 = {};
@@ -15321,7 +15465,7 @@ var init_lib25 = __esm(() => {
15321
15465
 
15322
15466
  // ../../node_modules/remark-gfm/index.js
15323
15467
  var init_remark_gfm = __esm(() => {
15324
- init_lib25();
15468
+ init_lib24();
15325
15469
  });
15326
15470
 
15327
15471
  // ../../node_modules/yaml/dist/nodes/identity.js
@@ -23572,13 +23716,13 @@ function parseSelector(selector, defaultTagName) {
23572
23716
  };
23573
23717
  }
23574
23718
  var search2;
23575
- var init_lib26 = __esm(() => {
23719
+ var init_lib25 = __esm(() => {
23576
23720
  search2 = /[#.]/g;
23577
23721
  });
23578
23722
 
23579
23723
  // ../../node_modules/hast-util-parse-selector/index.js
23580
23724
  var init_hast_util_parse_selector = __esm(() => {
23581
- init_lib26();
23725
+ init_lib25();
23582
23726
  });
23583
23727
 
23584
23728
  // ../../node_modules/space-separated-tokens/index.js
@@ -23615,7 +23759,7 @@ function createH(schema, defaultTagName, caseSensitive) {
23615
23759
  for (const child of children) {
23616
23760
  addChild(node.children, child);
23617
23761
  }
23618
- if (node.type === "element" && node.tagName === "template") {
23762
+ if (node.type === "element" && node.tagName === "template" && schema.space === "html") {
23619
23763
  node.content = { type: "root", children: node.children };
23620
23764
  node.children = [];
23621
23765
  }
@@ -23650,10 +23794,10 @@ function isChild(value) {
23650
23794
  return false;
23651
23795
  }
23652
23796
  function addProperty(schema, properties, key, value) {
23653
- const info = find(schema, key);
23654
- let result;
23655
23797
  if (value === null || value === undefined)
23656
23798
  return;
23799
+ const info = find(schema, key);
23800
+ let result;
23657
23801
  if (typeof value === "number") {
23658
23802
  if (Number.isNaN(value))
23659
23803
  return;
@@ -23683,7 +23827,8 @@ function addProperty(schema, properties, key, value) {
23683
23827
  result = finalResult;
23684
23828
  }
23685
23829
  if (info.property === "className" && Array.isArray(properties.className)) {
23686
- result = properties.className.concat(result);
23830
+ const add = result;
23831
+ result = [...properties.className, ...Array.isArray(add) ? add : [add]];
23687
23832
  }
23688
23833
  properties[info.property] = result;
23689
23834
  }
@@ -23782,7 +23927,7 @@ var init_svg_case_sensitive_tag_names = __esm(() => {
23782
23927
 
23783
23928
  // ../../node_modules/hastscript/lib/index.js
23784
23929
  var h, s;
23785
- var init_lib27 = __esm(() => {
23930
+ var init_lib26 = __esm(() => {
23786
23931
  init_property_information();
23787
23932
  init_create_h();
23788
23933
  init_svg_case_sensitive_tag_names();
@@ -23792,7 +23937,7 @@ var init_lib27 = __esm(() => {
23792
23937
 
23793
23938
  // ../../node_modules/hastscript/index.js
23794
23939
  var init_hastscript = __esm(() => {
23795
- init_lib27();
23940
+ init_lib26();
23796
23941
  });
23797
23942
 
23798
23943
  // ../../node_modules/vfile-location/lib/index.js
@@ -23932,7 +24077,7 @@ function all2(state, nodes) {
23932
24077
  return results;
23933
24078
  }
23934
24079
  function element(state, node) {
23935
- const schema = state.schema;
24080
+ const { schema } = state;
23936
24081
  state.schema = node.namespaceURI === webNamespaces.svg ? svg2 : html3;
23937
24082
  let index = -1;
23938
24083
  const properties = {};
@@ -23947,15 +24092,20 @@ function element(state, node) {
23947
24092
  const result = x(node.tagName, properties, all2(state, node.childNodes));
23948
24093
  patch(state, node, result);
23949
24094
  if (result.tagName === "template") {
23950
- const reference = node;
23951
- const pos = reference.sourceCodeLocation;
23952
- const startTag = pos && pos.startTag && position2(pos.startTag);
23953
- const endTag = pos && pos.endTag && position2(pos.endTag);
23954
- const content = one2(state, reference.content);
23955
- if (startTag && endTag && state.file) {
23956
- content.position = { start: startTag.end, end: endTag.start };
24095
+ if (node.namespaceURI === webNamespaces.html) {
24096
+ const reference = node;
24097
+ const pos = reference.sourceCodeLocation;
24098
+ const startTag = pos && pos.startTag && position2(pos.startTag);
24099
+ const endTag = pos && pos.endTag && position2(pos.endTag);
24100
+ const content = one2(state, reference.content);
24101
+ if (startTag && endTag && state.file) {
24102
+ content.position = { start: startTag.end, end: endTag.start };
24103
+ }
24104
+ result.content = content;
24105
+ } else if (result.content) {
24106
+ result.children = result.content.children;
24107
+ delete result.content;
23957
24108
  }
23958
- result.content = content;
23959
24109
  }
23960
24110
  state.schema = schema;
23961
24111
  return result;
@@ -23999,23 +24149,23 @@ function createLocation(state, node, location) {
23999
24149
  return result;
24000
24150
  }
24001
24151
  function position2(loc) {
24002
- const start = point3({
24152
+ const start = point4({
24003
24153
  line: loc.startLine,
24004
24154
  column: loc.startCol,
24005
24155
  offset: loc.startOffset
24006
24156
  });
24007
- const end = point3({
24157
+ const end = point4({
24008
24158
  line: loc.endLine,
24009
24159
  column: loc.endCol,
24010
24160
  offset: loc.endOffset
24011
24161
  });
24012
24162
  return start || end ? { start, end } : undefined;
24013
24163
  }
24014
- function point3(point) {
24164
+ function point4(point) {
24015
24165
  return point.line && point.column ? point : undefined;
24016
24166
  }
24017
24167
  var own9, proto;
24018
- var init_lib28 = __esm(() => {
24168
+ var init_lib27 = __esm(() => {
24019
24169
  init_development();
24020
24170
  init_hastscript();
24021
24171
  init_property_information();
@@ -24027,7 +24177,7 @@ var init_lib28 = __esm(() => {
24027
24177
 
24028
24178
  // ../../node_modules/hast-util-from-parse5/index.js
24029
24179
  var init_hast_util_from_parse5 = __esm(() => {
24030
- init_lib28();
24180
+ init_lib27();
24031
24181
  });
24032
24182
 
24033
24183
  // ../../node_modules/parse5/dist/common/unicode.js
@@ -31920,7 +32070,7 @@ function visualizeCharacterCode(charCode) {
31920
32070
  return "0x" + charCode.toString(16).toUpperCase();
31921
32071
  }
31922
32072
  var base = "https://html.spec.whatwg.org/multipage/parsing.html#parse-error-", dashToCamelRe, formatCRe, formatXRe, fatalities, emptyOptions4;
31923
- var init_lib29 = __esm(() => {
32073
+ var init_lib28 = __esm(() => {
31924
32074
  init_development();
31925
32075
  init_hast_util_from_parse5();
31926
32076
  init_dist3();
@@ -31936,24 +32086,24 @@ var init_lib29 = __esm(() => {
31936
32086
 
31937
32087
  // ../../node_modules/hast-util-from-html/index.js
31938
32088
  var init_hast_util_from_html = __esm(() => {
31939
- init_lib29();
32089
+ init_lib28();
31940
32090
  });
31941
32091
 
31942
32092
  // ../../node_modules/hast-util-whitespace/lib/index.js
31943
32093
  function whitespace(thing) {
31944
- return typeof thing === "object" ? thing.type === "text" ? empty4(thing.value) : false : empty4(thing);
32094
+ return typeof thing === "object" ? thing.type === "text" ? empty3(thing.value) : false : empty3(thing);
31945
32095
  }
31946
- function empty4(value) {
32096
+ function empty3(value) {
31947
32097
  return value.replace(re, "") === "";
31948
32098
  }
31949
32099
  var re;
31950
- var init_lib30 = __esm(() => {
32100
+ var init_lib29 = __esm(() => {
31951
32101
  re = /[ \t\n\f\r]/g;
31952
32102
  });
31953
32103
 
31954
32104
  // ../../node_modules/hast-util-whitespace/index.js
31955
32105
  var init_hast_util_whitespace = __esm(() => {
31956
- init_lib30();
32106
+ init_lib29();
31957
32107
  });
31958
32108
 
31959
32109
  // ../../packages/markup/src/html-to-jx.ts
@@ -32438,14 +32588,14 @@ function fence3(matter, prop) {
32438
32588
  function pick2(schema, prop) {
32439
32589
  return typeof schema === "string" ? schema : schema[prop];
32440
32590
  }
32441
- var init_lib31 = __esm(() => {
32591
+ var init_lib30 = __esm(() => {
32442
32592
  init_development();
32443
32593
  init_dev22();
32444
32594
  });
32445
32595
 
32446
32596
  // ../../node_modules/mdast-util-frontmatter/index.js
32447
32597
  var init_mdast_util_frontmatter = __esm(() => {
32448
- init_lib31();
32598
+ init_lib30();
32449
32599
  });
32450
32600
 
32451
32601
  // ../../node_modules/remark-frontmatter/lib/index.js
@@ -32461,14 +32611,14 @@ function remarkFrontmatter(options) {
32461
32611
  toMarkdownExtensions.push(frontmatterToMarkdown(settings));
32462
32612
  }
32463
32613
  var emptyOptions5 = "yaml";
32464
- var init_lib32 = __esm(() => {
32614
+ var init_lib31 = __esm(() => {
32465
32615
  init_mdast_util_frontmatter();
32466
32616
  init_dev22();
32467
32617
  });
32468
32618
 
32469
32619
  // ../../node_modules/remark-frontmatter/index.js
32470
32620
  var init_remark_frontmatter = __esm(() => {
32471
- init_lib32();
32621
+ init_lib31();
32472
32622
  });
32473
32623
 
32474
32624
  // ../../node_modules/unist-util-visit-parents/node_modules/unist-util-is/convert.js