@lvce-editor/markdown-worker 1.7.0 → 1.9.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.
@@ -620,7 +620,8 @@ const splitLines = lines => {
620
620
  return lines.split(NewLine);
621
621
  };
622
622
  const getCurrentStack = () => {
623
- const currentStack = joinLines(splitLines(new Error().stack || '').slice(2));
623
+ const stackLinesToSkip = 3;
624
+ const currentStack = joinLines(splitLines(new Error().stack || '').slice(stackLinesToSkip));
624
625
  return currentStack;
625
626
  };
626
627
  const getNewLineIndex = (string, startIndex = undefined) => {
@@ -891,6 +892,12 @@ const invokeAndTransfer = (ipc, method, ...params) => {
891
892
  return invokeHelper(ipc, method, params, true);
892
893
  };
893
894
 
895
+ class CommandNotFoundError extends Error {
896
+ constructor(command) {
897
+ super(`Command not found ${command}`);
898
+ this.name = 'CommandNotFoundError';
899
+ }
900
+ }
894
901
  const commands = Object.create(null);
895
902
  const register = commandMap => {
896
903
  Object.assign(commands, commandMap);
@@ -901,7 +908,7 @@ const getCommand = key => {
901
908
  const execute = (command, ...args) => {
902
909
  const fn = getCommand(command);
903
910
  if (!fn) {
904
- throw new Error(`command not found ${command}`);
911
+ throw new CommandNotFoundError(command);
905
912
  }
906
913
  return fn(...args);
907
914
  };
@@ -1022,7 +1029,7 @@ const Li$1 = 48;
1022
1029
  const Ol$1 = 49;
1023
1030
  const P$2 = 50;
1024
1031
  const Pre$1 = 51;
1025
- const A$2 = 53;
1032
+ const A$1 = 53;
1026
1033
  const Abbr$1 = 54;
1027
1034
  const Br$1 = 55;
1028
1035
  const Cite$1 = 56;
@@ -1031,7 +1038,7 @@ const Time$1 = 58;
1031
1038
  const Tfoot$1 = 59;
1032
1039
  const VirtualDomElements = {
1033
1040
  __proto__: null,
1034
- A: A$2,
1041
+ A: A$1,
1035
1042
  Abbr: Abbr$1,
1036
1043
  Article: Article$1,
1037
1044
  Aside: Aside$1,
@@ -1115,7 +1122,7 @@ const Li = 'li';
1115
1122
  const Ol = 'ol';
1116
1123
  const P$1 = 'p';
1117
1124
  const Pre = 'pre';
1118
- const A$1 = 'a';
1125
+ const A = 'a';
1119
1126
  const Abbr = 'abbr';
1120
1127
  const Br = 'br';
1121
1128
  const Cite = 'cite';
@@ -1169,7 +1176,7 @@ const getVirtualDomTag = text => {
1169
1176
  return VirtualDomElements.P;
1170
1177
  case Pre:
1171
1178
  return VirtualDomElements.Pre;
1172
- case A$1:
1179
+ case A:
1173
1180
  return VirtualDomElements.A;
1174
1181
  case Abbr:
1175
1182
  return VirtualDomElements.Abbr;
@@ -1553,7 +1560,7 @@ const handleMessagePort = async (port, rpcId) => {
1553
1560
  };
1554
1561
 
1555
1562
  /**
1556
- * marked v16.0.0 - a markdown parser
1563
+ * marked v16.2.0 - a markdown parser
1557
1564
  * Copyright (c) 2011-2025, Christopher Jeffrey. (MIT Licensed)
1558
1565
  * https://github.com/markedjs/marked
1559
1566
  */
@@ -1563,7 +1570,7 @@ const handleMessagePort = async (port, rpcId) => {
1563
1570
  * The code in this file is generated from files in ./src/
1564
1571
  */
1565
1572
 
1566
- function M() {
1573
+ function L() {
1567
1574
  return {
1568
1575
  async: false,
1569
1576
  breaks: false,
@@ -1577,19 +1584,19 @@ function M() {
1577
1584
  walkTokens: null
1578
1585
  };
1579
1586
  }
1580
- var w = M();
1581
- function H(a) {
1582
- w = a;
1587
+ var O = L();
1588
+ function H(l) {
1589
+ O = l;
1583
1590
  }
1584
- var C = {
1591
+ var E = {
1585
1592
  exec: () => null
1586
1593
  };
1587
- function h(a, e = "") {
1588
- let t = typeof a == "string" ? a : a.source,
1594
+ function h(l, e = "") {
1595
+ let t = typeof l == "string" ? l : l.source,
1589
1596
  n = {
1590
- replace: (s, i) => {
1591
- let r = typeof i == "string" ? i : i.source;
1592
- return r = r.replace(m.caret, "$1"), t = t.replace(s, r), n;
1597
+ replace: (r, i) => {
1598
+ let s = typeof i == "string" ? i : i.source;
1599
+ return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
1593
1600
  },
1594
1601
  getRegex: () => new RegExp(t, e)
1595
1602
  };
@@ -1646,83 +1653,83 @@ var m = {
1646
1653
  spaceLine: /^ +$/gm,
1647
1654
  notSpaceStart: /^\S*/,
1648
1655
  endingNewline: /\n$/,
1649
- listItemRegex: a => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`),
1650
- nextBulletRegex: a => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
1651
- hrRegex: a => new RegExp(`^ {0,${Math.min(3, a - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
1652
- fencesBeginRegex: a => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:\`\`\`|~~~)`),
1653
- headingBeginRegex: a => new RegExp(`^ {0,${Math.min(3, a - 1)}}#`),
1654
- htmlBeginRegex: a => new RegExp(`^ {0,${Math.min(3, a - 1)}}<(?:[a-z].*>|!--)`, "i")
1656
+ listItemRegex: l => new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),
1657
+ nextBulletRegex: l => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
1658
+ hrRegex: l => new RegExp(`^ {0,${Math.min(3, l - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
1659
+ fencesBeginRegex: l => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:\`\`\`|~~~)`),
1660
+ headingBeginRegex: l => new RegExp(`^ {0,${Math.min(3, l - 1)}}#`),
1661
+ htmlBeginRegex: l => new RegExp(`^ {0,${Math.min(3, l - 1)}}<(?:[a-z].*>|!--)`, "i")
1655
1662
  },
1656
1663
  xe = /^(?:[ \t]*(?:\n|$))+/,
1657
1664
  be = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,
1658
- Te = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
1659
- I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
1660
- we = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
1665
+ Re = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
1666
+ C = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
1667
+ Oe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
1661
1668
  j = /(?:[*+-]|\d{1,9}[.)])/,
1662
- re = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
1663
- ie = h(re).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(),
1664
- ye = h(re).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),
1669
+ se = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
1670
+ ie = h(se).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(),
1671
+ Te = h(se).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),
1665
1672
  F = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
1666
- Re = /^[^\n]+/,
1673
+ we = /^[^\n]+/,
1667
1674
  Q = /(?!\s*\])(?:\\.|[^\[\]\\])+/,
1668
- Se = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),
1669
- $e = h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, j).getRegex(),
1675
+ ye = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),
1676
+ Pe = h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, j).getRegex(),
1670
1677
  v = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",
1671
1678
  U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/,
1672
- _e = h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),
1673
- oe = h(F).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(),
1674
- Le = h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", oe).getRegex(),
1679
+ Se = h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),
1680
+ oe = h(F).replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(),
1681
+ $e = h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", oe).getRegex(),
1675
1682
  K = {
1676
- blockquote: Le,
1683
+ blockquote: $e,
1677
1684
  code: be,
1678
- def: Se,
1679
- fences: Te,
1680
- heading: we,
1681
- hr: I,
1682
- html: _e,
1685
+ def: ye,
1686
+ fences: Re,
1687
+ heading: Oe,
1688
+ hr: C,
1689
+ html: Se,
1683
1690
  lheading: ie,
1684
- list: $e,
1691
+ list: Pe,
1685
1692
  newline: xe,
1686
1693
  paragraph: oe,
1687
- table: C,
1688
- text: Re
1694
+ table: E,
1695
+ text: we
1689
1696
  },
1690
- se = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(),
1691
- ze = {
1697
+ re = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(),
1698
+ _e = {
1692
1699
  ...K,
1693
- lheading: ye,
1694
- table: se,
1695
- paragraph: h(F).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", se).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex()
1700
+ lheading: Te,
1701
+ table: re,
1702
+ paragraph: h(F).replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex()
1696
1703
  },
1697
- Me = {
1704
+ Le = {
1698
1705
  ...K,
1699
1706
  html: h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", U).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
1700
1707
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
1701
1708
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
1702
- fences: C,
1709
+ fences: E,
1703
1710
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
1704
- paragraph: h(F).replace("hr", I).replace("heading", ` *#{1,6} *[^
1711
+ paragraph: h(F).replace("hr", C).replace("heading", ` *#{1,6} *[^
1705
1712
  ]`).replace("lheading", ie).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
1706
1713
  },
1707
- Pe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
1708
- Ae = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
1709
- le = /^( {2,}|\\)\n(?!\s*$)/,
1710
- Ee = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
1714
+ Me = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
1715
+ ze = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
1716
+ ae = /^( {2,}|\\)\n(?!\s*$)/,
1717
+ Ae = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
1711
1718
  D = /[\p{P}\p{S}]/u,
1712
- X = /[\s\p{P}\p{S}]/u,
1713
- ae = /[^\s\p{P}\p{S}]/u,
1714
- Ce = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, X).getRegex(),
1715
- ce = /(?!~)[\p{P}\p{S}]/u,
1716
- Ie = /(?!~)[\s\p{P}\p{S}]/u,
1717
- Oe = /(?:[^\s\p{P}\p{S}]|~)/u,
1718
- Be = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,
1719
+ W = /[\s\p{P}\p{S}]/u,
1720
+ le = /[^\s\p{P}\p{S}]/u,
1721
+ Ee = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex(),
1722
+ ue = /(?!~)[\p{P}\p{S}]/u,
1723
+ Ce = /(?!~)[\s\p{P}\p{S}]/u,
1724
+ Ie = /(?:[^\s\p{P}\p{S}]|~)/u,
1725
+ Be = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,
1719
1726
  pe = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,
1720
1727
  qe = h(pe, "u").replace(/punct/g, D).getRegex(),
1721
- ve = h(pe, "u").replace(/punct/g, ce).getRegex(),
1722
- ue = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",
1723
- De = h(ue, "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, X).replace(/punct/g, D).getRegex(),
1724
- Ze = h(ue, "gu").replace(/notPunctSpace/g, Oe).replace(/punctSpace/g, Ie).replace(/punct/g, ce).getRegex(),
1725
- Ge = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, X).replace(/punct/g, D).getRegex(),
1728
+ ve = h(pe, "u").replace(/punct/g, ue).getRegex(),
1729
+ ce = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",
1730
+ De = h(ce, "gu").replace(/notPunctSpace/g, le).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(),
1731
+ Ze = h(ce, "gu").replace(/notPunctSpace/g, Ie).replace(/punctSpace/g, Ce).replace(/punct/g, ue).getRegex(),
1732
+ Ge = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, le).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(),
1726
1733
  He = h(/\\(punct)/, "gu").replace(/punct/g, D).getRegex(),
1727
1734
  Ne = h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),
1728
1735
  je = h(U).replace("(?:-->|$)", "-->").getRegex(),
@@ -1730,36 +1737,36 @@ var m = {
1730
1737
  q = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,
1731
1738
  Qe = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),
1732
1739
  he = h(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex(),
1733
- ke = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex(),
1734
- Ue = h("reflink|nolink(?!\\()", "g").replace("reflink", he).replace("nolink", ke).getRegex(),
1735
- W = {
1736
- _backpedal: C,
1740
+ de = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex(),
1741
+ Ue = h("reflink|nolink(?!\\()", "g").replace("reflink", he).replace("nolink", de).getRegex(),
1742
+ X = {
1743
+ _backpedal: E,
1737
1744
  anyPunctuation: He,
1738
1745
  autolink: Ne,
1739
1746
  blockSkip: Be,
1740
- br: le,
1741
- code: Ae,
1742
- del: C,
1747
+ br: ae,
1748
+ code: ze,
1749
+ del: E,
1743
1750
  emStrongLDelim: qe,
1744
1751
  emStrongRDelimAst: De,
1745
1752
  emStrongRDelimUnd: Ge,
1746
- escape: Pe,
1753
+ escape: Me,
1747
1754
  link: Qe,
1748
- nolink: ke,
1749
- punctuation: Ce,
1755
+ nolink: de,
1756
+ punctuation: Ee,
1750
1757
  reflink: he,
1751
1758
  reflinkSearch: Ue,
1752
1759
  tag: Fe,
1753
- text: Ee,
1754
- url: C
1760
+ text: Ae,
1761
+ url: E
1755
1762
  },
1756
1763
  Ke = {
1757
- ...W,
1764
+ ...X,
1758
1765
  link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(),
1759
1766
  reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex()
1760
1767
  },
1761
1768
  N = {
1762
- ...W,
1769
+ ...X,
1763
1770
  emStrongRDelimAst: Ze,
1764
1771
  emStrongLDelim: ve,
1765
1772
  url: h(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
@@ -1767,107 +1774,107 @@ var m = {
1767
1774
  del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
1768
1775
  text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
1769
1776
  },
1770
- Xe = {
1777
+ We = {
1771
1778
  ...N,
1772
- br: h(le).replace("{2,}", "*").getRegex(),
1779
+ br: h(ae).replace("{2,}", "*").getRegex(),
1773
1780
  text: h(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
1774
1781
  },
1775
- O = {
1782
+ I = {
1776
1783
  normal: K,
1777
- gfm: ze,
1778
- pedantic: Me
1784
+ gfm: _e,
1785
+ pedantic: Le
1779
1786
  },
1780
- P = {
1781
- normal: W,
1787
+ M = {
1788
+ normal: X,
1782
1789
  gfm: N,
1783
- breaks: Xe,
1790
+ breaks: We,
1784
1791
  pedantic: Ke
1785
1792
  };
1786
- var We = {
1793
+ var Xe = {
1787
1794
  "&": "&amp;",
1788
1795
  "<": "&lt;",
1789
1796
  ">": "&gt;",
1790
1797
  '"': "&quot;",
1791
1798
  "'": "&#39;"
1792
1799
  },
1793
- ge = a => We[a];
1794
- function R(a, e) {
1800
+ ke = l => Xe[l];
1801
+ function w(l, e) {
1795
1802
  if (e) {
1796
- if (m.escapeTest.test(a)) return a.replace(m.escapeReplace, ge);
1797
- } else if (m.escapeTestNoEncode.test(a)) return a.replace(m.escapeReplaceNoEncode, ge);
1798
- return a;
1803
+ if (m.escapeTest.test(l)) return l.replace(m.escapeReplace, ke);
1804
+ } else if (m.escapeTestNoEncode.test(l)) return l.replace(m.escapeReplaceNoEncode, ke);
1805
+ return l;
1799
1806
  }
1800
- function J(a) {
1807
+ function J(l) {
1801
1808
  try {
1802
- a = encodeURI(a).replace(m.percentDecode, "%");
1809
+ l = encodeURI(l).replace(m.percentDecode, "%");
1803
1810
  } catch {
1804
1811
  return null;
1805
1812
  }
1806
- return a;
1813
+ return l;
1807
1814
  }
1808
- function V(a, e) {
1809
- let t = a.replace(m.findPipe, (i, r, o) => {
1810
- let l = false,
1811
- c = r;
1812
- for (; --c >= 0 && o[c] === "\\";) l = !l;
1813
- return l ? "|" : " |";
1815
+ function V(l, e) {
1816
+ let t = l.replace(m.findPipe, (i, s, o) => {
1817
+ let a = false,
1818
+ u = s;
1819
+ for (; --u >= 0 && o[u] === "\\";) a = !a;
1820
+ return a ? "|" : " |";
1814
1821
  }),
1815
1822
  n = t.split(m.splitPipe),
1816
- s = 0;
1823
+ r = 0;
1817
1824
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);else for (; n.length < e;) n.push("");
1818
- for (; s < n.length; s++) n[s] = n[s].trim().replace(m.slashPipe, "|");
1825
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(m.slashPipe, "|");
1819
1826
  return n;
1820
1827
  }
1821
- function A(a, e, t) {
1822
- let n = a.length;
1828
+ function z(l, e, t) {
1829
+ let n = l.length;
1823
1830
  if (n === 0) return "";
1824
- let s = 0;
1825
- for (; s < n;) {
1826
- let i = a.charAt(n - s - 1);
1827
- if (i === e && true) s++;else break;
1831
+ let r = 0;
1832
+ for (; r < n;) {
1833
+ let i = l.charAt(n - r - 1);
1834
+ if (i === e && true) r++;else break;
1828
1835
  }
1829
- return a.slice(0, n - s);
1836
+ return l.slice(0, n - r);
1830
1837
  }
1831
- function fe(a, e) {
1832
- if (a.indexOf(e[1]) === -1) return -1;
1838
+ function ge(l, e) {
1839
+ if (l.indexOf(e[1]) === -1) return -1;
1833
1840
  let t = 0;
1834
- for (let n = 0; n < a.length; n++) if (a[n] === "\\") n++;else if (a[n] === e[0]) t++;else if (a[n] === e[1] && (t--, t < 0)) return n;
1841
+ for (let n = 0; n < l.length; n++) if (l[n] === "\\") n++;else if (l[n] === e[0]) t++;else if (l[n] === e[1] && (t--, t < 0)) return n;
1835
1842
  return t > 0 ? -2 : -1;
1836
1843
  }
1837
- function de(a, e, t, n, s) {
1844
+ function fe(l, e, t, n, r) {
1838
1845
  let i = e.href,
1839
- r = e.title || null,
1840
- o = a[1].replace(s.other.outputLinkReplace, "$1");
1846
+ s = e.title || null,
1847
+ o = l[1].replace(r.other.outputLinkReplace, "$1");
1841
1848
  n.state.inLink = true;
1842
- let l = {
1843
- type: a[0].charAt(0) === "!" ? "image" : "link",
1849
+ let a = {
1850
+ type: l[0].charAt(0) === "!" ? "image" : "link",
1844
1851
  raw: t,
1845
1852
  href: i,
1846
- title: r,
1853
+ title: s,
1847
1854
  text: o,
1848
1855
  tokens: n.inlineTokens(o)
1849
1856
  };
1850
- return n.state.inLink = false, l;
1857
+ return n.state.inLink = false, a;
1851
1858
  }
1852
- function Je(a, e, t) {
1853
- let n = a.match(t.other.indentCodeCompensation);
1859
+ function Je(l, e, t) {
1860
+ let n = l.match(t.other.indentCodeCompensation);
1854
1861
  if (n === null) return e;
1855
- let s = n[1];
1862
+ let r = n[1];
1856
1863
  return e.split(`
1857
1864
  `).map(i => {
1858
- let r = i.match(t.other.beginningSpace);
1859
- if (r === null) return i;
1860
- let [o] = r;
1861
- return o.length >= s.length ? i.slice(s.length) : i;
1865
+ let s = i.match(t.other.beginningSpace);
1866
+ if (s === null) return i;
1867
+ let [o] = s;
1868
+ return o.length >= r.length ? i.slice(r.length) : i;
1862
1869
  }).join(`
1863
1870
  `);
1864
1871
  }
1865
- var S = class {
1872
+ var y = class {
1866
1873
  options;
1867
1874
  rules;
1868
1875
  lexer;
1869
1876
  constructor(e) {
1870
- this.options = e || w;
1877
+ this.options = e || O;
1871
1878
  }
1872
1879
  space(e) {
1873
1880
  let t = this.rules.block.newline.exec(e);
@@ -1884,7 +1891,7 @@ var S = class {
1884
1891
  type: "code",
1885
1892
  raw: t[0],
1886
1893
  codeBlockStyle: "indented",
1887
- text: this.options.pedantic ? n : A(n, `
1894
+ text: this.options.pedantic ? n : z(n, `
1888
1895
  `)
1889
1896
  };
1890
1897
  }
@@ -1893,12 +1900,12 @@ var S = class {
1893
1900
  let t = this.rules.block.fences.exec(e);
1894
1901
  if (t) {
1895
1902
  let n = t[0],
1896
- s = Je(n, t[3] || "", this.rules);
1903
+ r = Je(n, t[3] || "", this.rules);
1897
1904
  return {
1898
1905
  type: "code",
1899
1906
  raw: n,
1900
1907
  lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
1901
- text: s
1908
+ text: r
1902
1909
  };
1903
1910
  }
1904
1911
  }
@@ -1907,8 +1914,8 @@ var S = class {
1907
1914
  if (t) {
1908
1915
  let n = t[2].trim();
1909
1916
  if (this.rules.other.endingHash.test(n)) {
1910
- let s = A(n, "#");
1911
- (this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (n = s.trim());
1917
+ let r = z(n, "#");
1918
+ (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
1912
1919
  }
1913
1920
  return {
1914
1921
  type: "heading",
@@ -1923,59 +1930,59 @@ var S = class {
1923
1930
  let t = this.rules.block.hr.exec(e);
1924
1931
  if (t) return {
1925
1932
  type: "hr",
1926
- raw: A(t[0], `
1933
+ raw: z(t[0], `
1927
1934
  `)
1928
1935
  };
1929
1936
  }
1930
1937
  blockquote(e) {
1931
1938
  let t = this.rules.block.blockquote.exec(e);
1932
1939
  if (t) {
1933
- let n = A(t[0], `
1940
+ let n = z(t[0], `
1934
1941
  `).split(`
1935
1942
  `),
1936
- s = "",
1943
+ r = "",
1937
1944
  i = "",
1938
- r = [];
1945
+ s = [];
1939
1946
  for (; n.length > 0;) {
1940
1947
  let o = false,
1941
- l = [],
1942
- c;
1943
- for (c = 0; c < n.length; c++) if (this.rules.other.blockquoteStart.test(n[c])) l.push(n[c]), o = true;else if (!o) l.push(n[c]);else break;
1944
- n = n.slice(c);
1945
- let p = l.join(`
1948
+ a = [],
1949
+ u;
1950
+ for (u = 0; u < n.length; u++) if (this.rules.other.blockquoteStart.test(n[u])) a.push(n[u]), o = true;else if (!o) a.push(n[u]);else break;
1951
+ n = n.slice(u);
1952
+ let p = a.join(`
1946
1953
  `),
1947
- u = p.replace(this.rules.other.blockquoteSetextReplace, `
1954
+ c = p.replace(this.rules.other.blockquoteSetextReplace, `
1948
1955
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
1949
- s = s ? `${s}
1956
+ r = r ? `${r}
1950
1957
  ${p}` : p, i = i ? `${i}
1951
- ${u}` : u;
1952
- let d = this.lexer.state.top;
1953
- if (this.lexer.state.top = true, this.lexer.blockTokens(u, r, true), this.lexer.state.top = d, n.length === 0) break;
1954
- let g = r.at(-1);
1955
- if (g?.type === "code") break;
1956
- if (g?.type === "blockquote") {
1957
- let x = g,
1958
- f = x.raw + `
1958
+ ${c}` : c;
1959
+ let f = this.lexer.state.top;
1960
+ if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top = f, n.length === 0) break;
1961
+ let k = s.at(-1);
1962
+ if (k?.type === "code") break;
1963
+ if (k?.type === "blockquote") {
1964
+ let x = k,
1965
+ g = x.raw + `
1959
1966
  ` + n.join(`
1960
1967
  `),
1961
- y = this.blockquote(f);
1962
- r[r.length - 1] = y, s = s.substring(0, s.length - x.raw.length) + y.raw, i = i.substring(0, i.length - x.text.length) + y.text;
1968
+ T = this.blockquote(g);
1969
+ s[s.length - 1] = T, r = r.substring(0, r.length - x.raw.length) + T.raw, i = i.substring(0, i.length - x.text.length) + T.text;
1963
1970
  break;
1964
- } else if (g?.type === "list") {
1965
- let x = g,
1966
- f = x.raw + `
1971
+ } else if (k?.type === "list") {
1972
+ let x = k,
1973
+ g = x.raw + `
1967
1974
  ` + n.join(`
1968
1975
  `),
1969
- y = this.list(f);
1970
- r[r.length - 1] = y, s = s.substring(0, s.length - g.raw.length) + y.raw, i = i.substring(0, i.length - x.raw.length) + y.raw, n = f.substring(r.at(-1).raw.length).split(`
1976
+ T = this.list(g);
1977
+ s[s.length - 1] = T, r = r.substring(0, r.length - k.raw.length) + T.raw, i = i.substring(0, i.length - x.raw.length) + T.raw, n = g.substring(s.at(-1).raw.length).split(`
1971
1978
  `);
1972
1979
  continue;
1973
1980
  }
1974
1981
  }
1975
1982
  return {
1976
1983
  type: "blockquote",
1977
- raw: s,
1978
- tokens: r,
1984
+ raw: r,
1985
+ tokens: s,
1979
1986
  text: i
1980
1987
  };
1981
1988
  }
@@ -1984,74 +1991,74 @@ ${u}` : u;
1984
1991
  let t = this.rules.block.list.exec(e);
1985
1992
  if (t) {
1986
1993
  let n = t[1].trim(),
1987
- s = n.length > 1,
1994
+ r = n.length > 1,
1988
1995
  i = {
1989
1996
  type: "list",
1990
1997
  raw: "",
1991
- ordered: s,
1992
- start: s ? +n.slice(0, -1) : "",
1998
+ ordered: r,
1999
+ start: r ? +n.slice(0, -1) : "",
1993
2000
  loose: false,
1994
2001
  items: []
1995
2002
  };
1996
- n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]");
1997
- let r = this.rules.other.listItemRegex(n),
2003
+ n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
2004
+ let s = this.rules.other.listItemRegex(n),
1998
2005
  o = false;
1999
2006
  for (; e;) {
2000
- let c = false,
2007
+ let u = false,
2001
2008
  p = "",
2002
- u = "";
2003
- if (!(t = r.exec(e)) || this.rules.block.hr.test(e)) break;
2009
+ c = "";
2010
+ if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
2004
2011
  p = t[0], e = e.substring(p.length);
2005
- let d = t[2].split(`
2012
+ let f = t[2].split(`
2006
2013
  `, 1)[0].replace(this.rules.other.listReplaceTabs, Z => " ".repeat(3 * Z.length)),
2007
- g = e.split(`
2014
+ k = e.split(`
2008
2015
  `, 1)[0],
2009
- x = !d.trim(),
2010
- f = 0;
2011
- if (this.options.pedantic ? (f = 2, u = d.trimStart()) : x ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, u = d.slice(f), f += t[1].length), x && this.rules.other.blankLine.test(g) && (p += g + `
2012
- `, e = e.substring(g.length + 1), c = true), !c) {
2013
- let Z = this.rules.other.nextBulletRegex(f),
2014
- ee = this.rules.other.hrRegex(f),
2015
- te = this.rules.other.fencesBeginRegex(f),
2016
- ne = this.rules.other.headingBeginRegex(f),
2017
- me = this.rules.other.htmlBeginRegex(f);
2016
+ x = !f.trim(),
2017
+ g = 0;
2018
+ if (this.options.pedantic ? (g = 2, c = f.trimStart()) : x ? g = t[1].length + 1 : (g = t[2].search(this.rules.other.nonSpaceChar), g = g > 4 ? 1 : g, c = f.slice(g), g += t[1].length), x && this.rules.other.blankLine.test(k) && (p += k + `
2019
+ `, e = e.substring(k.length + 1), u = true), !u) {
2020
+ let Z = this.rules.other.nextBulletRegex(g),
2021
+ ee = this.rules.other.hrRegex(g),
2022
+ te = this.rules.other.fencesBeginRegex(g),
2023
+ ne = this.rules.other.headingBeginRegex(g),
2024
+ me = this.rules.other.htmlBeginRegex(g);
2018
2025
  for (; e;) {
2019
2026
  let G = e.split(`
2020
2027
  `, 1)[0],
2021
- E;
2022
- if (g = G, this.options.pedantic ? (g = g.replace(this.rules.other.listReplaceNesting, " "), E = g) : E = g.replace(this.rules.other.tabCharGlobal, " "), te.test(g) || ne.test(g) || me.test(g) || Z.test(g) || ee.test(g)) break;
2023
- if (E.search(this.rules.other.nonSpaceChar) >= f || !g.trim()) u += `
2024
- ` + E.slice(f);else {
2025
- if (x || d.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te.test(d) || ne.test(d) || ee.test(d)) break;
2026
- u += `
2027
- ` + g;
2028
+ A;
2029
+ if (k = G, this.options.pedantic ? (k = k.replace(this.rules.other.listReplaceNesting, " "), A = k) : A = k.replace(this.rules.other.tabCharGlobal, " "), te.test(k) || ne.test(k) || me.test(k) || Z.test(k) || ee.test(k)) break;
2030
+ if (A.search(this.rules.other.nonSpaceChar) >= g || !k.trim()) c += `
2031
+ ` + A.slice(g);else {
2032
+ if (x || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te.test(f) || ne.test(f) || ee.test(f)) break;
2033
+ c += `
2034
+ ` + k;
2028
2035
  }
2029
- !x && !g.trim() && (x = true), p += G + `
2030
- `, e = e.substring(G.length + 1), d = E.slice(f);
2036
+ !x && !k.trim() && (x = true), p += G + `
2037
+ `, e = e.substring(G.length + 1), f = A.slice(g);
2031
2038
  }
2032
2039
  }
2033
2040
  i.loose || (o ? i.loose = true : this.rules.other.doubleBlankLine.test(p) && (o = true));
2034
- let y = null,
2041
+ let T = null,
2035
2042
  Y;
2036
- this.options.gfm && (y = this.rules.other.listIsTask.exec(u), y && (Y = y[0] !== "[ ] ", u = u.replace(this.rules.other.listReplaceTask, ""))), i.items.push({
2043
+ this.options.gfm && (T = this.rules.other.listIsTask.exec(c), T && (Y = T[0] !== "[ ] ", c = c.replace(this.rules.other.listReplaceTask, ""))), i.items.push({
2037
2044
  type: "list_item",
2038
2045
  raw: p,
2039
- task: !!y,
2046
+ task: !!T,
2040
2047
  checked: Y,
2041
2048
  loose: false,
2042
- text: u,
2049
+ text: c,
2043
2050
  tokens: []
2044
2051
  }), i.raw += p;
2045
2052
  }
2046
- let l = i.items.at(-1);
2047
- if (l) l.raw = l.raw.trimEnd(), l.text = l.text.trimEnd();else return;
2053
+ let a = i.items.at(-1);
2054
+ if (a) a.raw = a.raw.trimEnd(), a.text = a.text.trimEnd();else return;
2048
2055
  i.raw = i.raw.trimEnd();
2049
- for (let c = 0; c < i.items.length; c++) if (this.lexer.state.top = false, i.items[c].tokens = this.lexer.blockTokens(i.items[c].text, []), !i.loose) {
2050
- let p = i.items[c].tokens.filter(d => d.type === "space"),
2051
- u = p.length > 0 && p.some(d => this.rules.other.anyLine.test(d.raw));
2052
- i.loose = u;
2056
+ for (let u = 0; u < i.items.length; u++) if (this.lexer.state.top = false, i.items[u].tokens = this.lexer.blockTokens(i.items[u].text, []), !i.loose) {
2057
+ let p = i.items[u].tokens.filter(f => f.type === "space"),
2058
+ c = p.length > 0 && p.some(f => this.rules.other.anyLine.test(f.raw));
2059
+ i.loose = c;
2053
2060
  }
2054
- if (i.loose) for (let c = 0; c < i.items.length; c++) i.items[c].loose = true;
2061
+ if (i.loose) for (let u = 0; u < i.items.length; u++) i.items[u].loose = true;
2055
2062
  return i;
2056
2063
  }
2057
2064
  }
@@ -2069,13 +2076,13 @@ ${u}` : u;
2069
2076
  let t = this.rules.block.def.exec(e);
2070
2077
  if (t) {
2071
2078
  let n = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "),
2072
- s = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "",
2079
+ r = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "",
2073
2080
  i = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
2074
2081
  return {
2075
2082
  type: "def",
2076
2083
  tag: n,
2077
2084
  raw: t[0],
2078
- href: s,
2085
+ href: r,
2079
2086
  title: i
2080
2087
  };
2081
2088
  }
@@ -2084,31 +2091,31 @@ ${u}` : u;
2084
2091
  let t = this.rules.block.table.exec(e);
2085
2092
  if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
2086
2093
  let n = V(t[1]),
2087
- s = t[2].replace(this.rules.other.tableAlignChars, "").split("|"),
2094
+ r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"),
2088
2095
  i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
2089
2096
  `) : [],
2090
- r = {
2097
+ s = {
2091
2098
  type: "table",
2092
2099
  raw: t[0],
2093
2100
  header: [],
2094
2101
  align: [],
2095
2102
  rows: []
2096
2103
  };
2097
- if (n.length === s.length) {
2098
- for (let o of s) this.rules.other.tableAlignRight.test(o) ? r.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? r.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? r.align.push("left") : r.align.push(null);
2099
- for (let o = 0; o < n.length; o++) r.header.push({
2104
+ if (n.length === r.length) {
2105
+ for (let o of r) this.rules.other.tableAlignRight.test(o) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? s.align.push("left") : s.align.push(null);
2106
+ for (let o = 0; o < n.length; o++) s.header.push({
2100
2107
  text: n[o],
2101
2108
  tokens: this.lexer.inline(n[o]),
2102
2109
  header: true,
2103
- align: r.align[o]
2110
+ align: s.align[o]
2104
2111
  });
2105
- for (let o of i) r.rows.push(V(o, r.header.length).map((l, c) => ({
2106
- text: l,
2107
- tokens: this.lexer.inline(l),
2112
+ for (let o of i) s.rows.push(V(o, s.header.length).map((a, u) => ({
2113
+ text: a,
2114
+ tokens: this.lexer.inline(a),
2108
2115
  header: false,
2109
- align: r.align[c]
2116
+ align: s.align[u]
2110
2117
  })));
2111
- return r;
2118
+ return s;
2112
2119
  }
2113
2120
  }
2114
2121
  lheading(e) {
@@ -2168,24 +2175,24 @@ ${u}` : u;
2168
2175
  let n = t[2].trim();
2169
2176
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
2170
2177
  if (!this.rules.other.endAngleBracket.test(n)) return;
2171
- let r = A(n.slice(0, -1), "\\");
2172
- if ((n.length - r.length) % 2 === 0) return;
2178
+ let s = z(n.slice(0, -1), "\\");
2179
+ if ((n.length - s.length) % 2 === 0) return;
2173
2180
  } else {
2174
- let r = fe(t[2], "()");
2175
- if (r === -2) return;
2176
- if (r > -1) {
2177
- let l = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + r;
2178
- t[2] = t[2].substring(0, r), t[0] = t[0].substring(0, l).trim(), t[3] = "";
2181
+ let s = ge(t[2], "()");
2182
+ if (s === -2) return;
2183
+ if (s > -1) {
2184
+ let a = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
2185
+ t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, a).trim(), t[3] = "";
2179
2186
  }
2180
2187
  }
2181
- let s = t[2],
2188
+ let r = t[2],
2182
2189
  i = "";
2183
2190
  if (this.options.pedantic) {
2184
- let r = this.rules.other.pedanticHrefTitle.exec(s);
2185
- r && (s = r[1], i = r[3]);
2191
+ let s = this.rules.other.pedanticHrefTitle.exec(r);
2192
+ s && (r = s[1], i = s[3]);
2186
2193
  } else i = t[3] ? t[3].slice(1, -1) : "";
2187
- return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? s = s.slice(1) : s = s.slice(1, -1)), de(t, {
2188
- href: s && s.replace(this.rules.inline.anyPunctuation, "$1"),
2194
+ return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), fe(t, {
2195
+ href: r && r.replace(this.rules.inline.anyPunctuation, "$1"),
2189
2196
  title: i && i.replace(this.rules.inline.anyPunctuation, "$1")
2190
2197
  }, t[0], this.lexer, this.rules);
2191
2198
  }
@@ -2193,55 +2200,55 @@ ${u}` : u;
2193
2200
  reflink(e, t) {
2194
2201
  let n;
2195
2202
  if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
2196
- let s = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "),
2197
- i = t[s.toLowerCase()];
2203
+ let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "),
2204
+ i = t[r.toLowerCase()];
2198
2205
  if (!i) {
2199
- let r = n[0].charAt(0);
2206
+ let s = n[0].charAt(0);
2200
2207
  return {
2201
2208
  type: "text",
2202
- raw: r,
2203
- text: r
2209
+ raw: s,
2210
+ text: s
2204
2211
  };
2205
2212
  }
2206
- return de(n, i, n[0], this.lexer, this.rules);
2213
+ return fe(n, i, n[0], this.lexer, this.rules);
2207
2214
  }
2208
2215
  }
2209
2216
  emStrong(e, t, n = "") {
2210
- let s = this.rules.inline.emStrongLDelim.exec(e);
2211
- if (!s || s[3] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
2212
- if (!(s[1] || s[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
2213
- let r = [...s[0]].length - 1,
2217
+ let r = this.rules.inline.emStrongLDelim.exec(e);
2218
+ if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
2219
+ if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
2220
+ let s = [...r[0]].length - 1,
2214
2221
  o,
2215
- l,
2216
- c = r,
2222
+ a,
2223
+ u = s,
2217
2224
  p = 0,
2218
- u = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
2219
- for (u.lastIndex = 0, t = t.slice(-1 * e.length + r); (s = u.exec(t)) != null;) {
2220
- if (o = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !o) continue;
2221
- if (l = [...o].length, s[3] || s[4]) {
2222
- c += l;
2225
+ c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
2226
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = c.exec(t)) != null;) {
2227
+ if (o = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !o) continue;
2228
+ if (a = [...o].length, r[3] || r[4]) {
2229
+ u += a;
2223
2230
  continue;
2224
- } else if ((s[5] || s[6]) && r % 3 && !((r + l) % 3)) {
2225
- p += l;
2231
+ } else if ((r[5] || r[6]) && s % 3 && !((s + a) % 3)) {
2232
+ p += a;
2226
2233
  continue;
2227
2234
  }
2228
- if (c -= l, c > 0) continue;
2229
- l = Math.min(l, l + c + p);
2230
- let d = [...s[0]][0].length,
2231
- g = e.slice(0, r + s.index + d + l);
2232
- if (Math.min(r, l) % 2) {
2233
- let f = g.slice(1, -1);
2235
+ if (u -= a, u > 0) continue;
2236
+ a = Math.min(a, a + u + p);
2237
+ let f = [...r[0]][0].length,
2238
+ k = e.slice(0, s + r.index + f + a);
2239
+ if (Math.min(s, a) % 2) {
2240
+ let g = k.slice(1, -1);
2234
2241
  return {
2235
2242
  type: "em",
2236
- raw: g,
2237
- text: f,
2238
- tokens: this.lexer.inlineTokens(f)
2243
+ raw: k,
2244
+ text: g,
2245
+ tokens: this.lexer.inlineTokens(g)
2239
2246
  };
2240
2247
  }
2241
- let x = g.slice(2, -2);
2248
+ let x = k.slice(2, -2);
2242
2249
  return {
2243
2250
  type: "strong",
2244
- raw: g,
2251
+ raw: k,
2245
2252
  text: x,
2246
2253
  tokens: this.lexer.inlineTokens(x)
2247
2254
  };
@@ -2252,9 +2259,9 @@ ${u}` : u;
2252
2259
  let t = this.rules.inline.code.exec(e);
2253
2260
  if (t) {
2254
2261
  let n = t[2].replace(this.rules.other.newLineCharGlobal, " "),
2255
- s = this.rules.other.nonSpaceChar.test(n),
2262
+ r = this.rules.other.nonSpaceChar.test(n),
2256
2263
  i = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
2257
- return s && i && (n = n.substring(1, n.length - 1)), {
2264
+ return r && i && (n = n.substring(1, n.length - 1)), {
2258
2265
  type: "codespan",
2259
2266
  raw: t[0],
2260
2267
  text: n
@@ -2280,12 +2287,12 @@ ${u}` : u;
2280
2287
  autolink(e) {
2281
2288
  let t = this.rules.inline.autolink.exec(e);
2282
2289
  if (t) {
2283
- let n, s;
2284
- return t[2] === "@" ? (n = t[1], s = "mailto:" + n) : (n = t[1], s = n), {
2290
+ let n, r;
2291
+ return t[2] === "@" ? (n = t[1], r = "mailto:" + n) : (n = t[1], r = n), {
2285
2292
  type: "link",
2286
2293
  raw: t[0],
2287
2294
  text: n,
2288
- href: s,
2295
+ href: r,
2289
2296
  tokens: [{
2290
2297
  type: "text",
2291
2298
  raw: n,
@@ -2297,17 +2304,17 @@ ${u}` : u;
2297
2304
  url(e) {
2298
2305
  let t;
2299
2306
  if (t = this.rules.inline.url.exec(e)) {
2300
- let n, s;
2301
- if (t[2] === "@") n = t[0], s = "mailto:" + n;else {
2307
+ let n, r;
2308
+ if (t[2] === "@") n = t[0], r = "mailto:" + n;else {
2302
2309
  let i;
2303
2310
  do i = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? ""; while (i !== t[0]);
2304
- n = t[0], t[1] === "www." ? s = "http://" + t[0] : s = t[0];
2311
+ n = t[0], t[1] === "www." ? r = "http://" + t[0] : r = t[0];
2305
2312
  }
2306
2313
  return {
2307
2314
  type: "link",
2308
2315
  raw: t[0],
2309
2316
  text: n,
2310
- href: s,
2317
+ href: r,
2311
2318
  tokens: [{
2312
2319
  type: "text",
2313
2320
  raw: n,
@@ -2329,36 +2336,36 @@ ${u}` : u;
2329
2336
  }
2330
2337
  }
2331
2338
  };
2332
- var b = class a {
2339
+ var b = class l {
2333
2340
  tokens;
2334
2341
  options;
2335
2342
  state;
2336
2343
  tokenizer;
2337
2344
  inlineQueue;
2338
2345
  constructor(e) {
2339
- this.tokens = [], this.tokens.links = Object.create(null), this.options = e || w, this.options.tokenizer = this.options.tokenizer || new S(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
2346
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || O, this.options.tokenizer = this.options.tokenizer || new y(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
2340
2347
  inLink: false,
2341
2348
  inRawBlock: false,
2342
2349
  top: true
2343
2350
  };
2344
2351
  let t = {
2345
2352
  other: m,
2346
- block: O.normal,
2347
- inline: P.normal
2353
+ block: I.normal,
2354
+ inline: M.normal
2348
2355
  };
2349
- this.options.pedantic ? (t.block = O.pedantic, t.inline = P.pedantic) : this.options.gfm && (t.block = O.gfm, this.options.breaks ? t.inline = P.breaks : t.inline = P.gfm), this.tokenizer.rules = t;
2356
+ this.options.pedantic ? (t.block = I.pedantic, t.inline = M.pedantic) : this.options.gfm && (t.block = I.gfm, this.options.breaks ? t.inline = M.breaks : t.inline = M.gfm), this.tokenizer.rules = t;
2350
2357
  }
2351
2358
  static get rules() {
2352
2359
  return {
2353
- block: O,
2354
- inline: P
2360
+ block: I,
2361
+ inline: M
2355
2362
  };
2356
2363
  }
2357
2364
  static lex(e, t) {
2358
- return new a(t).lex(e);
2365
+ return new l(t).lex(e);
2359
2366
  }
2360
2367
  static lexInline(e, t) {
2361
- return new a(t).inlineTokens(e);
2368
+ return new l(t).inlineTokens(e);
2362
2369
  }
2363
2370
  lex(e) {
2364
2371
  e = e.replace(m.carriageReturn, `
@@ -2371,100 +2378,104 @@ var b = class a {
2371
2378
  }
2372
2379
  blockTokens(e, t = [], n = false) {
2373
2380
  for (this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e;) {
2374
- let s;
2375
- if (this.options.extensions?.block?.some(r => (s = r.call({
2381
+ let r;
2382
+ if (this.options.extensions?.block?.some(s => (r = s.call({
2376
2383
  lexer: this
2377
- }, e, t)) ? (e = e.substring(s.raw.length), t.push(s), true) : false)) continue;
2378
- if (s = this.tokenizer.space(e)) {
2379
- e = e.substring(s.raw.length);
2380
- let r = t.at(-1);
2381
- s.raw.length === 1 && r !== void 0 ? r.raw += `
2382
- ` : t.push(s);
2384
+ }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), true) : false)) continue;
2385
+ if (r = this.tokenizer.space(e)) {
2386
+ e = e.substring(r.raw.length);
2387
+ let s = t.at(-1);
2388
+ r.raw.length === 1 && s !== void 0 ? s.raw += `
2389
+ ` : t.push(r);
2383
2390
  continue;
2384
2391
  }
2385
- if (s = this.tokenizer.code(e)) {
2386
- e = e.substring(s.raw.length);
2387
- let r = t.at(-1);
2388
- r?.type === "paragraph" || r?.type === "text" ? (r.raw += `
2389
- ` + s.raw, r.text += `
2390
- ` + s.text, this.inlineQueue.at(-1).src = r.text) : t.push(s);
2392
+ if (r = this.tokenizer.code(e)) {
2393
+ e = e.substring(r.raw.length);
2394
+ let s = t.at(-1);
2395
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
2396
+ `) ? "" : `
2397
+ `) + r.raw, s.text += `
2398
+ ` + r.text, this.inlineQueue.at(-1).src = s.text) : t.push(r);
2391
2399
  continue;
2392
2400
  }
2393
- if (s = this.tokenizer.fences(e)) {
2394
- e = e.substring(s.raw.length), t.push(s);
2401
+ if (r = this.tokenizer.fences(e)) {
2402
+ e = e.substring(r.raw.length), t.push(r);
2395
2403
  continue;
2396
2404
  }
2397
- if (s = this.tokenizer.heading(e)) {
2398
- e = e.substring(s.raw.length), t.push(s);
2405
+ if (r = this.tokenizer.heading(e)) {
2406
+ e = e.substring(r.raw.length), t.push(r);
2399
2407
  continue;
2400
2408
  }
2401
- if (s = this.tokenizer.hr(e)) {
2402
- e = e.substring(s.raw.length), t.push(s);
2409
+ if (r = this.tokenizer.hr(e)) {
2410
+ e = e.substring(r.raw.length), t.push(r);
2403
2411
  continue;
2404
2412
  }
2405
- if (s = this.tokenizer.blockquote(e)) {
2406
- e = e.substring(s.raw.length), t.push(s);
2413
+ if (r = this.tokenizer.blockquote(e)) {
2414
+ e = e.substring(r.raw.length), t.push(r);
2407
2415
  continue;
2408
2416
  }
2409
- if (s = this.tokenizer.list(e)) {
2410
- e = e.substring(s.raw.length), t.push(s);
2417
+ if (r = this.tokenizer.list(e)) {
2418
+ e = e.substring(r.raw.length), t.push(r);
2411
2419
  continue;
2412
2420
  }
2413
- if (s = this.tokenizer.html(e)) {
2414
- e = e.substring(s.raw.length), t.push(s);
2421
+ if (r = this.tokenizer.html(e)) {
2422
+ e = e.substring(r.raw.length), t.push(r);
2415
2423
  continue;
2416
2424
  }
2417
- if (s = this.tokenizer.def(e)) {
2418
- e = e.substring(s.raw.length);
2419
- let r = t.at(-1);
2420
- r?.type === "paragraph" || r?.type === "text" ? (r.raw += `
2421
- ` + s.raw, r.text += `
2422
- ` + s.raw, this.inlineQueue.at(-1).src = r.text) : this.tokens.links[s.tag] || (this.tokens.links[s.tag] = {
2423
- href: s.href,
2424
- title: s.title
2425
- });
2425
+ if (r = this.tokenizer.def(e)) {
2426
+ e = e.substring(r.raw.length);
2427
+ let s = t.at(-1);
2428
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
2429
+ `) ? "" : `
2430
+ `) + r.raw, s.text += `
2431
+ ` + r.raw, this.inlineQueue.at(-1).src = s.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
2432
+ href: r.href,
2433
+ title: r.title
2434
+ }, t.push(r));
2426
2435
  continue;
2427
2436
  }
2428
- if (s = this.tokenizer.table(e)) {
2429
- e = e.substring(s.raw.length), t.push(s);
2437
+ if (r = this.tokenizer.table(e)) {
2438
+ e = e.substring(r.raw.length), t.push(r);
2430
2439
  continue;
2431
2440
  }
2432
- if (s = this.tokenizer.lheading(e)) {
2433
- e = e.substring(s.raw.length), t.push(s);
2441
+ if (r = this.tokenizer.lheading(e)) {
2442
+ e = e.substring(r.raw.length), t.push(r);
2434
2443
  continue;
2435
2444
  }
2436
2445
  let i = e;
2437
2446
  if (this.options.extensions?.startBlock) {
2438
- let r = 1 / 0,
2447
+ let s = 1 / 0,
2439
2448
  o = e.slice(1),
2440
- l;
2441
- this.options.extensions.startBlock.forEach(c => {
2442
- l = c.call({
2449
+ a;
2450
+ this.options.extensions.startBlock.forEach(u => {
2451
+ a = u.call({
2443
2452
  lexer: this
2444
- }, o), typeof l == "number" && l >= 0 && (r = Math.min(r, l));
2445
- }), r < 1 / 0 && r >= 0 && (i = e.substring(0, r + 1));
2453
+ }, o), typeof a == "number" && a >= 0 && (s = Math.min(s, a));
2454
+ }), s < 1 / 0 && s >= 0 && (i = e.substring(0, s + 1));
2446
2455
  }
2447
- if (this.state.top && (s = this.tokenizer.paragraph(i))) {
2448
- let r = t.at(-1);
2449
- n && r?.type === "paragraph" ? (r.raw += `
2450
- ` + s.raw, r.text += `
2451
- ` + s.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = r.text) : t.push(s), n = i.length !== e.length, e = e.substring(s.raw.length);
2456
+ if (this.state.top && (r = this.tokenizer.paragraph(i))) {
2457
+ let s = t.at(-1);
2458
+ n && s?.type === "paragraph" ? (s.raw += (s.raw.endsWith(`
2459
+ `) ? "" : `
2460
+ `) + r.raw, s.text += `
2461
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r), n = i.length !== e.length, e = e.substring(r.raw.length);
2452
2462
  continue;
2453
2463
  }
2454
- if (s = this.tokenizer.text(e)) {
2455
- e = e.substring(s.raw.length);
2456
- let r = t.at(-1);
2457
- r?.type === "text" ? (r.raw += `
2458
- ` + s.raw, r.text += `
2459
- ` + s.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = r.text) : t.push(s);
2464
+ if (r = this.tokenizer.text(e)) {
2465
+ e = e.substring(r.raw.length);
2466
+ let s = t.at(-1);
2467
+ s?.type === "text" ? (s.raw += (s.raw.endsWith(`
2468
+ `) ? "" : `
2469
+ `) + r.raw, s.text += `
2470
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r);
2460
2471
  continue;
2461
2472
  }
2462
2473
  if (e) {
2463
- let r = "Infinite loop on byte: " + e.charCodeAt(0);
2474
+ let s = "Infinite loop on byte: " + e.charCodeAt(0);
2464
2475
  if (this.options.silent) {
2465
- console.error(r);
2476
+ console.error(s);
2466
2477
  break;
2467
- } else throw new Error(r);
2478
+ } else throw new Error(s);
2468
2479
  }
2469
2480
  }
2470
2481
  return this.state.top = true, t;
@@ -2477,19 +2488,19 @@ var b = class a {
2477
2488
  }
2478
2489
  inlineTokens(e, t = []) {
2479
2490
  let n = e,
2480
- s = null;
2491
+ r = null;
2481
2492
  if (this.tokens.links) {
2482
2493
  let o = Object.keys(this.tokens.links);
2483
- if (o.length > 0) for (; (s = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null;) o.includes(s[0].slice(s[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, s.index) + "[" + "a".repeat(s[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
2494
+ if (o.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null;) o.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
2484
2495
  }
2485
- for (; (s = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null;) n = n.slice(0, s.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
2486
- for (; (s = this.tokenizer.rules.inline.blockSkip.exec(n)) != null;) n = n.slice(0, s.index) + "[" + "a".repeat(s[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
2496
+ for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null;) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
2497
+ for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null;) n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
2487
2498
  let i = false,
2488
- r = "";
2499
+ s = "";
2489
2500
  for (; e;) {
2490
- i || (r = ""), i = false;
2501
+ i || (s = ""), i = false;
2491
2502
  let o;
2492
- if (this.options.extensions?.inline?.some(c => (o = c.call({
2503
+ if (this.options.extensions?.inline?.some(u => (o = u.call({
2493
2504
  lexer: this
2494
2505
  }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false)) continue;
2495
2506
  if (o = this.tokenizer.escape(e)) {
@@ -2506,11 +2517,11 @@ var b = class a {
2506
2517
  }
2507
2518
  if (o = this.tokenizer.reflink(e, this.tokens.links)) {
2508
2519
  e = e.substring(o.raw.length);
2509
- let c = t.at(-1);
2510
- o.type === "text" && c?.type === "text" ? (c.raw += o.raw, c.text += o.text) : t.push(o);
2520
+ let u = t.at(-1);
2521
+ o.type === "text" && u?.type === "text" ? (u.raw += o.raw, u.text += o.text) : t.push(o);
2511
2522
  continue;
2512
2523
  }
2513
- if (o = this.tokenizer.emStrong(e, n, r)) {
2524
+ if (o = this.tokenizer.emStrong(e, n, s)) {
2514
2525
  e = e.substring(o.raw.length), t.push(o);
2515
2526
  continue;
2516
2527
  }
@@ -2534,39 +2545,39 @@ var b = class a {
2534
2545
  e = e.substring(o.raw.length), t.push(o);
2535
2546
  continue;
2536
2547
  }
2537
- let l = e;
2548
+ let a = e;
2538
2549
  if (this.options.extensions?.startInline) {
2539
- let c = 1 / 0,
2550
+ let u = 1 / 0,
2540
2551
  p = e.slice(1),
2541
- u;
2542
- this.options.extensions.startInline.forEach(d => {
2543
- u = d.call({
2552
+ c;
2553
+ this.options.extensions.startInline.forEach(f => {
2554
+ c = f.call({
2544
2555
  lexer: this
2545
- }, p), typeof u == "number" && u >= 0 && (c = Math.min(c, u));
2546
- }), c < 1 / 0 && c >= 0 && (l = e.substring(0, c + 1));
2556
+ }, p), typeof c == "number" && c >= 0 && (u = Math.min(u, c));
2557
+ }), u < 1 / 0 && u >= 0 && (a = e.substring(0, u + 1));
2547
2558
  }
2548
- if (o = this.tokenizer.inlineText(l)) {
2549
- e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (r = o.raw.slice(-1)), i = true;
2550
- let c = t.at(-1);
2551
- c?.type === "text" ? (c.raw += o.raw, c.text += o.text) : t.push(o);
2559
+ if (o = this.tokenizer.inlineText(a)) {
2560
+ e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (s = o.raw.slice(-1)), i = true;
2561
+ let u = t.at(-1);
2562
+ u?.type === "text" ? (u.raw += o.raw, u.text += o.text) : t.push(o);
2552
2563
  continue;
2553
2564
  }
2554
2565
  if (e) {
2555
- let c = "Infinite loop on byte: " + e.charCodeAt(0);
2566
+ let u = "Infinite loop on byte: " + e.charCodeAt(0);
2556
2567
  if (this.options.silent) {
2557
- console.error(c);
2568
+ console.error(u);
2558
2569
  break;
2559
- } else throw new Error(c);
2570
+ } else throw new Error(u);
2560
2571
  }
2561
2572
  }
2562
2573
  return t;
2563
2574
  }
2564
2575
  };
2565
- var $ = class {
2576
+ var P = class {
2566
2577
  options;
2567
2578
  parser;
2568
2579
  constructor(e) {
2569
- this.options = e || w;
2580
+ this.options = e || O;
2570
2581
  }
2571
2582
  space(e) {
2572
2583
  return "";
@@ -2576,11 +2587,11 @@ var $ = class {
2576
2587
  lang: t,
2577
2588
  escaped: n
2578
2589
  }) {
2579
- let s = (t || "").match(m.notSpaceStart)?.[0],
2590
+ let r = (t || "").match(m.notSpaceStart)?.[0],
2580
2591
  i = e.replace(m.endingNewline, "") + `
2581
2592
  `;
2582
- return s ? '<pre><code class="language-' + R(s) + '">' + (n ? i : R(i, true)) + `</code></pre>
2583
- ` : "<pre><code>" + (n ? i : R(i, true)) + `</code></pre>
2593
+ return r ? '<pre><code class="language-' + w(r) + '">' + (n ? i : w(i, true)) + `</code></pre>
2594
+ ` : "<pre><code>" + (n ? i : w(i, true)) + `</code></pre>
2584
2595
  `;
2585
2596
  }
2586
2597
  blockquote({
@@ -2595,6 +2606,9 @@ ${this.parser.parse(e)}</blockquote>
2595
2606
  }) {
2596
2607
  return e;
2597
2608
  }
2609
+ def(e) {
2610
+ return "";
2611
+ }
2598
2612
  heading({
2599
2613
  tokens: e,
2600
2614
  depth: t
@@ -2609,15 +2623,15 @@ ${this.parser.parse(e)}</blockquote>
2609
2623
  list(e) {
2610
2624
  let t = e.ordered,
2611
2625
  n = e.start,
2612
- s = "";
2626
+ r = "";
2613
2627
  for (let o = 0; o < e.items.length; o++) {
2614
- let l = e.items[o];
2615
- s += this.listitem(l);
2628
+ let a = e.items[o];
2629
+ r += this.listitem(a);
2616
2630
  }
2617
2631
  let i = t ? "ol" : "ul",
2618
- r = t && n !== 1 ? ' start="' + n + '"' : "";
2619
- return "<" + i + r + `>
2620
- ` + s + "</" + i + `>
2632
+ s = t && n !== 1 ? ' start="' + n + '"' : "";
2633
+ return "<" + i + s + `>
2634
+ ` + r + "</" + i + `>
2621
2635
  `;
2622
2636
  }
2623
2637
  listitem(e) {
@@ -2626,7 +2640,7 @@ ${this.parser.parse(e)}</blockquote>
2626
2640
  let n = this.checkbox({
2627
2641
  checked: !!e.checked
2628
2642
  });
2629
- e.loose ? e.tokens[0]?.type === "paragraph" ? (e.tokens[0].text = n + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = n + " " + R(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = true)) : e.tokens.unshift({
2643
+ e.loose ? e.tokens[0]?.type === "paragraph" ? (e.tokens[0].text = n + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = n + " " + w(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = true)) : e.tokens.unshift({
2630
2644
  type: "text",
2631
2645
  raw: n + " ",
2632
2646
  text: n + " ",
@@ -2654,19 +2668,19 @@ ${this.parser.parse(e)}</blockquote>
2654
2668
  t += this.tablerow({
2655
2669
  text: n
2656
2670
  });
2657
- let s = "";
2671
+ let r = "";
2658
2672
  for (let i = 0; i < e.rows.length; i++) {
2659
- let r = e.rows[i];
2673
+ let s = e.rows[i];
2660
2674
  n = "";
2661
- for (let o = 0; o < r.length; o++) n += this.tablecell(r[o]);
2662
- s += this.tablerow({
2675
+ for (let o = 0; o < s.length; o++) n += this.tablecell(s[o]);
2676
+ r += this.tablerow({
2663
2677
  text: n
2664
2678
  });
2665
2679
  }
2666
- return s && (s = `<tbody>${s}</tbody>`), `<table>
2680
+ return r && (r = `<tbody>${r}</tbody>`), `<table>
2667
2681
  <thead>
2668
2682
  ` + t + `</thead>
2669
- ` + s + `</table>
2683
+ ` + r + `</table>
2670
2684
  `;
2671
2685
  }
2672
2686
  tablerow({
@@ -2695,7 +2709,7 @@ ${e}</tr>
2695
2709
  codespan({
2696
2710
  text: e
2697
2711
  }) {
2698
- return `<code>${R(e, true)}</code>`;
2712
+ return `<code>${w(e, true)}</code>`;
2699
2713
  }
2700
2714
  br(e) {
2701
2715
  return "<br>";
@@ -2710,31 +2724,31 @@ ${e}</tr>
2710
2724
  title: t,
2711
2725
  tokens: n
2712
2726
  }) {
2713
- let s = this.parser.parseInline(n),
2727
+ let r = this.parser.parseInline(n),
2714
2728
  i = J(e);
2715
- if (i === null) return s;
2729
+ if (i === null) return r;
2716
2730
  e = i;
2717
- let r = '<a href="' + e + '"';
2718
- return t && (r += ' title="' + R(t) + '"'), r += ">" + s + "</a>", r;
2731
+ let s = '<a href="' + e + '"';
2732
+ return t && (s += ' title="' + w(t) + '"'), s += ">" + r + "</a>", s;
2719
2733
  }
2720
2734
  image({
2721
2735
  href: e,
2722
2736
  title: t,
2723
2737
  text: n,
2724
- tokens: s
2738
+ tokens: r
2725
2739
  }) {
2726
- s && (n = this.parser.parseInline(s, this.parser.textRenderer));
2740
+ r && (n = this.parser.parseInline(r, this.parser.textRenderer));
2727
2741
  let i = J(e);
2728
- if (i === null) return R(n);
2742
+ if (i === null) return w(n);
2729
2743
  e = i;
2730
- let r = `<img src="${e}" alt="${n}"`;
2731
- return t && (r += ` title="${R(t)}"`), r += ">", r;
2744
+ let s = `<img src="${e}" alt="${n}"`;
2745
+ return t && (s += ` title="${w(t)}"`), s += ">", s;
2732
2746
  }
2733
2747
  text(e) {
2734
- return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : R(e.text);
2748
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : w(e.text);
2735
2749
  }
2736
2750
  };
2737
- var _ = class {
2751
+ var S = class {
2738
2752
  strong({
2739
2753
  text: e
2740
2754
  }) {
@@ -2779,102 +2793,107 @@ var _ = class {
2779
2793
  return "";
2780
2794
  }
2781
2795
  };
2782
- var T = class a {
2796
+ var R = class l {
2783
2797
  options;
2784
2798
  renderer;
2785
2799
  textRenderer;
2786
2800
  constructor(e) {
2787
- this.options = e || w, this.options.renderer = this.options.renderer || new $(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new _();
2801
+ this.options = e || O, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new S();
2788
2802
  }
2789
2803
  static parse(e, t) {
2790
- return new a(t).parse(e);
2804
+ return new l(t).parse(e);
2791
2805
  }
2792
2806
  static parseInline(e, t) {
2793
- return new a(t).parseInline(e);
2807
+ return new l(t).parseInline(e);
2794
2808
  }
2795
2809
  parse(e, t = true) {
2796
2810
  let n = "";
2797
- for (let s = 0; s < e.length; s++) {
2798
- let i = e[s];
2811
+ for (let r = 0; r < e.length; r++) {
2812
+ let i = e[r];
2799
2813
  if (this.options.extensions?.renderers?.[i.type]) {
2800
2814
  let o = i,
2801
- l = this.options.extensions.renderers[o.type].call({
2815
+ a = this.options.extensions.renderers[o.type].call({
2802
2816
  parser: this
2803
2817
  }, o);
2804
- if (l !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(o.type)) {
2805
- n += l || "";
2818
+ if (a !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(o.type)) {
2819
+ n += a || "";
2806
2820
  continue;
2807
2821
  }
2808
2822
  }
2809
- let r = i;
2810
- switch (r.type) {
2823
+ let s = i;
2824
+ switch (s.type) {
2811
2825
  case "space":
2812
2826
  {
2813
- n += this.renderer.space(r);
2827
+ n += this.renderer.space(s);
2814
2828
  continue;
2815
2829
  }
2816
2830
  case "hr":
2817
2831
  {
2818
- n += this.renderer.hr(r);
2832
+ n += this.renderer.hr(s);
2819
2833
  continue;
2820
2834
  }
2821
2835
  case "heading":
2822
2836
  {
2823
- n += this.renderer.heading(r);
2837
+ n += this.renderer.heading(s);
2824
2838
  continue;
2825
2839
  }
2826
2840
  case "code":
2827
2841
  {
2828
- n += this.renderer.code(r);
2842
+ n += this.renderer.code(s);
2829
2843
  continue;
2830
2844
  }
2831
2845
  case "table":
2832
2846
  {
2833
- n += this.renderer.table(r);
2847
+ n += this.renderer.table(s);
2834
2848
  continue;
2835
2849
  }
2836
2850
  case "blockquote":
2837
2851
  {
2838
- n += this.renderer.blockquote(r);
2852
+ n += this.renderer.blockquote(s);
2839
2853
  continue;
2840
2854
  }
2841
2855
  case "list":
2842
2856
  {
2843
- n += this.renderer.list(r);
2857
+ n += this.renderer.list(s);
2844
2858
  continue;
2845
2859
  }
2846
2860
  case "html":
2847
2861
  {
2848
- n += this.renderer.html(r);
2862
+ n += this.renderer.html(s);
2863
+ continue;
2864
+ }
2865
+ case "def":
2866
+ {
2867
+ n += this.renderer.def(s);
2849
2868
  continue;
2850
2869
  }
2851
2870
  case "paragraph":
2852
2871
  {
2853
- n += this.renderer.paragraph(r);
2872
+ n += this.renderer.paragraph(s);
2854
2873
  continue;
2855
2874
  }
2856
2875
  case "text":
2857
2876
  {
2858
- let o = r,
2859
- l = this.renderer.text(o);
2860
- for (; s + 1 < e.length && e[s + 1].type === "text";) o = e[++s], l += `
2877
+ let o = s,
2878
+ a = this.renderer.text(o);
2879
+ for (; r + 1 < e.length && e[r + 1].type === "text";) o = e[++r], a += `
2861
2880
  ` + this.renderer.text(o);
2862
2881
  t ? n += this.renderer.paragraph({
2863
2882
  type: "paragraph",
2864
- raw: l,
2865
- text: l,
2883
+ raw: a,
2884
+ text: a,
2866
2885
  tokens: [{
2867
2886
  type: "text",
2868
- raw: l,
2869
- text: l,
2887
+ raw: a,
2888
+ text: a,
2870
2889
  escaped: true
2871
2890
  }]
2872
- }) : n += l;
2891
+ }) : n += a;
2873
2892
  continue;
2874
2893
  }
2875
2894
  default:
2876
2895
  {
2877
- let o = 'Token with "' + r.type + '" type was not found.';
2896
+ let o = 'Token with "' + s.type + '" type was not found.';
2878
2897
  if (this.options.silent) return console.error(o), "";
2879
2898
  throw new Error(o);
2880
2899
  }
@@ -2884,8 +2903,8 @@ var T = class a {
2884
2903
  }
2885
2904
  parseInline(e, t = this.renderer) {
2886
2905
  let n = "";
2887
- for (let s = 0; s < e.length; s++) {
2888
- let i = e[s];
2906
+ for (let r = 0; r < e.length; r++) {
2907
+ let i = e[r];
2889
2908
  if (this.options.extensions?.renderers?.[i.type]) {
2890
2909
  let o = this.options.extensions.renderers[i.type].call({
2891
2910
  parser: this
@@ -2895,61 +2914,61 @@ var T = class a {
2895
2914
  continue;
2896
2915
  }
2897
2916
  }
2898
- let r = i;
2899
- switch (r.type) {
2917
+ let s = i;
2918
+ switch (s.type) {
2900
2919
  case "escape":
2901
2920
  {
2902
- n += t.text(r);
2921
+ n += t.text(s);
2903
2922
  break;
2904
2923
  }
2905
2924
  case "html":
2906
2925
  {
2907
- n += t.html(r);
2926
+ n += t.html(s);
2908
2927
  break;
2909
2928
  }
2910
2929
  case "link":
2911
2930
  {
2912
- n += t.link(r);
2931
+ n += t.link(s);
2913
2932
  break;
2914
2933
  }
2915
2934
  case "image":
2916
2935
  {
2917
- n += t.image(r);
2936
+ n += t.image(s);
2918
2937
  break;
2919
2938
  }
2920
2939
  case "strong":
2921
2940
  {
2922
- n += t.strong(r);
2941
+ n += t.strong(s);
2923
2942
  break;
2924
2943
  }
2925
2944
  case "em":
2926
2945
  {
2927
- n += t.em(r);
2946
+ n += t.em(s);
2928
2947
  break;
2929
2948
  }
2930
2949
  case "codespan":
2931
2950
  {
2932
- n += t.codespan(r);
2951
+ n += t.codespan(s);
2933
2952
  break;
2934
2953
  }
2935
2954
  case "br":
2936
2955
  {
2937
- n += t.br(r);
2956
+ n += t.br(s);
2938
2957
  break;
2939
2958
  }
2940
2959
  case "del":
2941
2960
  {
2942
- n += t.del(r);
2961
+ n += t.del(s);
2943
2962
  break;
2944
2963
  }
2945
2964
  case "text":
2946
2965
  {
2947
- n += t.text(r);
2966
+ n += t.text(s);
2948
2967
  break;
2949
2968
  }
2950
2969
  default:
2951
2970
  {
2952
- let o = 'Token with "' + r.type + '" type was not found.';
2971
+ let o = 'Token with "' + s.type + '" type was not found.';
2953
2972
  if (this.options.silent) return console.error(o), "";
2954
2973
  throw new Error(o);
2955
2974
  }
@@ -2958,11 +2977,11 @@ var T = class a {
2958
2977
  return n;
2959
2978
  }
2960
2979
  };
2961
- var L = class {
2980
+ var $ = class {
2962
2981
  options;
2963
2982
  block;
2964
2983
  constructor(e) {
2965
- this.options = e || w;
2984
+ this.options = e || O;
2966
2985
  }
2967
2986
  static passThroughHooks = new Set(["preprocess", "postprocess", "processAllTokens"]);
2968
2987
  preprocess(e) {
@@ -2978,44 +2997,44 @@ var L = class {
2978
2997
  return this.block ? b.lex : b.lexInline;
2979
2998
  }
2980
2999
  provideParser() {
2981
- return this.block ? T.parse : T.parseInline;
3000
+ return this.block ? R.parse : R.parseInline;
2982
3001
  }
2983
3002
  };
2984
3003
  var B = class {
2985
- defaults = M();
3004
+ defaults = L();
2986
3005
  options = this.setOptions;
2987
3006
  parse = this.parseMarkdown(true);
2988
3007
  parseInline = this.parseMarkdown(false);
2989
- Parser = T;
2990
- Renderer = $;
2991
- TextRenderer = _;
3008
+ Parser = R;
3009
+ Renderer = P;
3010
+ TextRenderer = S;
2992
3011
  Lexer = b;
2993
- Tokenizer = S;
2994
- Hooks = L;
3012
+ Tokenizer = y;
3013
+ Hooks = $;
2995
3014
  constructor(...e) {
2996
3015
  this.use(...e);
2997
3016
  }
2998
3017
  walkTokens(e, t) {
2999
3018
  let n = [];
3000
- for (let s of e) switch (n = n.concat(t.call(this, s)), s.type) {
3019
+ for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
3001
3020
  case "table":
3002
3021
  {
3003
- let i = s;
3004
- for (let r of i.header) n = n.concat(this.walkTokens(r.tokens, t));
3005
- for (let r of i.rows) for (let o of r) n = n.concat(this.walkTokens(o.tokens, t));
3022
+ let i = r;
3023
+ for (let s of i.header) n = n.concat(this.walkTokens(s.tokens, t));
3024
+ for (let s of i.rows) for (let o of s) n = n.concat(this.walkTokens(o.tokens, t));
3006
3025
  break;
3007
3026
  }
3008
3027
  case "list":
3009
3028
  {
3010
- let i = s;
3029
+ let i = r;
3011
3030
  n = n.concat(this.walkTokens(i.items, t));
3012
3031
  break;
3013
3032
  }
3014
3033
  default:
3015
3034
  {
3016
- let i = s;
3017
- this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach(r => {
3018
- let o = i[r].flat(1 / 0);
3035
+ let i = r;
3036
+ this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach(s => {
3037
+ let o = i[s].flat(1 / 0);
3019
3038
  n = n.concat(this.walkTokens(o, t));
3020
3039
  }) : i.tokens && (n = n.concat(this.walkTokens(i.tokens, t)));
3021
3040
  }
@@ -3028,84 +3047,84 @@ var B = class {
3028
3047
  childTokens: {}
3029
3048
  };
3030
3049
  return e.forEach(n => {
3031
- let s = {
3050
+ let r = {
3032
3051
  ...n
3033
3052
  };
3034
- if (s.async = this.defaults.async || s.async || false, n.extensions && (n.extensions.forEach(i => {
3053
+ if (r.async = this.defaults.async || r.async || false, n.extensions && (n.extensions.forEach(i => {
3035
3054
  if (!i.name) throw new Error("extension name required");
3036
3055
  if ("renderer" in i) {
3037
- let r = t.renderers[i.name];
3038
- r ? t.renderers[i.name] = function (...o) {
3039
- let l = i.renderer.apply(this, o);
3040
- return l === false && (l = r.apply(this, o)), l;
3056
+ let s = t.renderers[i.name];
3057
+ s ? t.renderers[i.name] = function (...o) {
3058
+ let a = i.renderer.apply(this, o);
3059
+ return a === false && (a = s.apply(this, o)), a;
3041
3060
  } : t.renderers[i.name] = i.renderer;
3042
3061
  }
3043
3062
  if ("tokenizer" in i) {
3044
3063
  if (!i.level || i.level !== "block" && i.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
3045
- let r = t[i.level];
3046
- r ? r.unshift(i.tokenizer) : t[i.level] = [i.tokenizer], i.start && (i.level === "block" ? t.startBlock ? t.startBlock.push(i.start) : t.startBlock = [i.start] : i.level === "inline" && (t.startInline ? t.startInline.push(i.start) : t.startInline = [i.start]));
3064
+ let s = t[i.level];
3065
+ s ? s.unshift(i.tokenizer) : t[i.level] = [i.tokenizer], i.start && (i.level === "block" ? t.startBlock ? t.startBlock.push(i.start) : t.startBlock = [i.start] : i.level === "inline" && (t.startInline ? t.startInline.push(i.start) : t.startInline = [i.start]));
3047
3066
  }
3048
3067
  "childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
3049
- }), s.extensions = t), n.renderer) {
3050
- let i = this.defaults.renderer || new $(this.defaults);
3051
- for (let r in n.renderer) {
3052
- if (!(r in i)) throw new Error(`renderer '${r}' does not exist`);
3053
- if (["options", "parser"].includes(r)) continue;
3054
- let o = r,
3055
- l = n.renderer[o],
3056
- c = i[o];
3068
+ }), r.extensions = t), n.renderer) {
3069
+ let i = this.defaults.renderer || new P(this.defaults);
3070
+ for (let s in n.renderer) {
3071
+ if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
3072
+ if (["options", "parser"].includes(s)) continue;
3073
+ let o = s,
3074
+ a = n.renderer[o],
3075
+ u = i[o];
3057
3076
  i[o] = (...p) => {
3058
- let u = l.apply(i, p);
3059
- return u === false && (u = c.apply(i, p)), u || "";
3077
+ let c = a.apply(i, p);
3078
+ return c === false && (c = u.apply(i, p)), c || "";
3060
3079
  };
3061
3080
  }
3062
- s.renderer = i;
3081
+ r.renderer = i;
3063
3082
  }
3064
3083
  if (n.tokenizer) {
3065
- let i = this.defaults.tokenizer || new S(this.defaults);
3066
- for (let r in n.tokenizer) {
3067
- if (!(r in i)) throw new Error(`tokenizer '${r}' does not exist`);
3068
- if (["options", "rules", "lexer"].includes(r)) continue;
3069
- let o = r,
3070
- l = n.tokenizer[o],
3071
- c = i[o];
3084
+ let i = this.defaults.tokenizer || new y(this.defaults);
3085
+ for (let s in n.tokenizer) {
3086
+ if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
3087
+ if (["options", "rules", "lexer"].includes(s)) continue;
3088
+ let o = s,
3089
+ a = n.tokenizer[o],
3090
+ u = i[o];
3072
3091
  i[o] = (...p) => {
3073
- let u = l.apply(i, p);
3074
- return u === false && (u = c.apply(i, p)), u;
3092
+ let c = a.apply(i, p);
3093
+ return c === false && (c = u.apply(i, p)), c;
3075
3094
  };
3076
3095
  }
3077
- s.tokenizer = i;
3096
+ r.tokenizer = i;
3078
3097
  }
3079
3098
  if (n.hooks) {
3080
- let i = this.defaults.hooks || new L();
3081
- for (let r in n.hooks) {
3082
- if (!(r in i)) throw new Error(`hook '${r}' does not exist`);
3083
- if (["options", "block"].includes(r)) continue;
3084
- let o = r,
3085
- l = n.hooks[o],
3086
- c = i[o];
3087
- L.passThroughHooks.has(r) ? i[o] = p => {
3088
- if (this.defaults.async) return Promise.resolve(l.call(i, p)).then(d => c.call(i, d));
3089
- let u = l.call(i, p);
3090
- return c.call(i, u);
3099
+ let i = this.defaults.hooks || new $();
3100
+ for (let s in n.hooks) {
3101
+ if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
3102
+ if (["options", "block"].includes(s)) continue;
3103
+ let o = s,
3104
+ a = n.hooks[o],
3105
+ u = i[o];
3106
+ $.passThroughHooks.has(s) ? i[o] = p => {
3107
+ if (this.defaults.async) return Promise.resolve(a.call(i, p)).then(f => u.call(i, f));
3108
+ let c = a.call(i, p);
3109
+ return u.call(i, c);
3091
3110
  } : i[o] = (...p) => {
3092
- let u = l.apply(i, p);
3093
- return u === false && (u = c.apply(i, p)), u;
3111
+ let c = a.apply(i, p);
3112
+ return c === false && (c = u.apply(i, p)), c;
3094
3113
  };
3095
3114
  }
3096
- s.hooks = i;
3115
+ r.hooks = i;
3097
3116
  }
3098
3117
  if (n.walkTokens) {
3099
3118
  let i = this.defaults.walkTokens,
3100
- r = n.walkTokens;
3101
- s.walkTokens = function (o) {
3102
- let l = [];
3103
- return l.push(r.call(this, o)), i && (l = l.concat(i.call(this, o))), l;
3119
+ s = n.walkTokens;
3120
+ r.walkTokens = function (o) {
3121
+ let a = [];
3122
+ return a.push(s.call(this, o)), i && (a = a.concat(i.call(this, o))), a;
3104
3123
  };
3105
3124
  }
3106
3125
  this.defaults = {
3107
3126
  ...this.defaults,
3108
- ...s
3127
+ ...r
3109
3128
  };
3110
3129
  }), this;
3111
3130
  }
@@ -3119,31 +3138,31 @@ var B = class {
3119
3138
  return b.lex(e, t ?? this.defaults);
3120
3139
  }
3121
3140
  parser(e, t) {
3122
- return T.parse(e, t ?? this.defaults);
3141
+ return R.parse(e, t ?? this.defaults);
3123
3142
  }
3124
3143
  parseMarkdown(e) {
3125
- return (n, s) => {
3144
+ return (n, r) => {
3126
3145
  let i = {
3127
- ...s
3146
+ ...r
3128
3147
  },
3129
- r = {
3148
+ s = {
3130
3149
  ...this.defaults,
3131
3150
  ...i
3132
3151
  },
3133
- o = this.onError(!!r.silent, !!r.async);
3152
+ o = this.onError(!!s.silent, !!s.async);
3134
3153
  if (this.defaults.async === true && i.async === false) return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
3135
3154
  if (typeof n > "u" || n === null) return o(new Error("marked(): input parameter is undefined or null"));
3136
3155
  if (typeof n != "string") return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
3137
- r.hooks && (r.hooks.options = r, r.hooks.block = e);
3138
- let l = r.hooks ? r.hooks.provideLexer() : e ? b.lex : b.lexInline,
3139
- c = r.hooks ? r.hooks.provideParser() : e ? T.parse : T.parseInline;
3140
- if (r.async) return Promise.resolve(r.hooks ? r.hooks.preprocess(n) : n).then(p => l(p, r)).then(p => r.hooks ? r.hooks.processAllTokens(p) : p).then(p => r.walkTokens ? Promise.all(this.walkTokens(p, r.walkTokens)).then(() => p) : p).then(p => c(p, r)).then(p => r.hooks ? r.hooks.postprocess(p) : p).catch(o);
3156
+ s.hooks && (s.hooks.options = s, s.hooks.block = e);
3157
+ let a = s.hooks ? s.hooks.provideLexer() : e ? b.lex : b.lexInline,
3158
+ u = s.hooks ? s.hooks.provideParser() : e ? R.parse : R.parseInline;
3159
+ if (s.async) return Promise.resolve(s.hooks ? s.hooks.preprocess(n) : n).then(p => a(p, s)).then(p => s.hooks ? s.hooks.processAllTokens(p) : p).then(p => s.walkTokens ? Promise.all(this.walkTokens(p, s.walkTokens)).then(() => p) : p).then(p => u(p, s)).then(p => s.hooks ? s.hooks.postprocess(p) : p).catch(o);
3141
3160
  try {
3142
- r.hooks && (n = r.hooks.preprocess(n));
3143
- let p = l(n, r);
3144
- r.hooks && (p = r.hooks.processAllTokens(p)), r.walkTokens && this.walkTokens(p, r.walkTokens);
3145
- let u = c(p, r);
3146
- return r.hooks && (u = r.hooks.postprocess(u)), u;
3161
+ s.hooks && (n = s.hooks.preprocess(n));
3162
+ let p = a(n, s);
3163
+ s.hooks && (p = s.hooks.processAllTokens(p)), s.walkTokens && this.walkTokens(p, s.walkTokens);
3164
+ let c = u(p, s);
3165
+ return s.hooks && (c = s.hooks.postprocess(c)), c;
3147
3166
  } catch (p) {
3148
3167
  return o(p);
3149
3168
  }
@@ -3153,42 +3172,42 @@ var B = class {
3153
3172
  return n => {
3154
3173
  if (n.message += `
3155
3174
  Please report this to https://github.com/markedjs/marked.`, e) {
3156
- let s = "<p>An error occurred:</p><pre>" + R(n.message + "", true) + "</pre>";
3157
- return t ? Promise.resolve(s) : s;
3175
+ let r = "<p>An error occurred:</p><pre>" + w(n.message + "", true) + "</pre>";
3176
+ return t ? Promise.resolve(r) : r;
3158
3177
  }
3159
3178
  if (t) return Promise.reject(n);
3160
3179
  throw n;
3161
3180
  };
3162
3181
  }
3163
3182
  };
3164
- var z = new B();
3165
- function k(a, e) {
3166
- return z.parse(a, e);
3183
+ var _ = new B();
3184
+ function d(l, e) {
3185
+ return _.parse(l, e);
3167
3186
  }
3168
- k.options = k.setOptions = function (a) {
3169
- return z.setOptions(a), k.defaults = z.defaults, H(k.defaults), k;
3170
- };
3171
- k.getDefaults = M;
3172
- k.defaults = w;
3173
- k.use = function (...a) {
3174
- return z.use(...a), k.defaults = z.defaults, H(k.defaults), k;
3175
- };
3176
- k.walkTokens = function (a, e) {
3177
- return z.walkTokens(a, e);
3178
- };
3179
- k.parseInline = z.parseInline;
3180
- k.Parser = T;
3181
- k.parser = T.parse;
3182
- k.Renderer = $;
3183
- k.TextRenderer = _;
3184
- k.Lexer = b;
3185
- k.lexer = b.lex;
3186
- k.Tokenizer = S;
3187
- k.Hooks = L;
3188
- k.parse = k;
3187
+ d.options = d.setOptions = function (l) {
3188
+ return _.setOptions(l), d.defaults = _.defaults, H(d.defaults), d;
3189
+ };
3190
+ d.getDefaults = L;
3191
+ d.defaults = O;
3192
+ d.use = function (...l) {
3193
+ return _.use(...l), d.defaults = _.defaults, H(d.defaults), d;
3194
+ };
3195
+ d.walkTokens = function (l, e) {
3196
+ return _.walkTokens(l, e);
3197
+ };
3198
+ d.parseInline = _.parseInline;
3199
+ d.Parser = R;
3200
+ d.parser = R.parse;
3201
+ d.Renderer = P;
3202
+ d.TextRenderer = S;
3203
+ d.Lexer = b;
3204
+ d.lexer = b.lex;
3205
+ d.Tokenizer = y;
3206
+ d.Hooks = $;
3207
+ d.parse = d;
3189
3208
 
3190
3209
  const renderMarkdown = async (markdown, options = {}) => {
3191
- const html = await k(markdown, {});
3210
+ const html = await d(markdown, {});
3192
3211
  return html;
3193
3212
  };
3194
3213