@boldare/askdare 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- // ../../node_modules/.pnpm/marked@18.2.0/node_modules/marked/lib/marked.esm.js
2
+ // ../../node_modules/.pnpm/marked@18.2.1/node_modules/marked/lib/marked.esm.js
3
3
  /**
4
- * marked v18.2.0 - a markdown parser
4
+ * marked v18.2.1 - a markdown parser
5
5
  * Copyright (c) 2018-2026, MarkedJS. (MIT License)
6
6
  * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
7
7
  * https://github.com/markedjs/marked
@@ -10,7 +10,7 @@
10
10
  * DO NOT EDIT THIS FILE
11
11
  * The code in this file is generated from files in ./src/
12
12
  */
13
- function j() {
13
+ function G() {
14
14
  return {
15
15
  async: !1,
16
16
  breaks: !1,
@@ -24,36 +24,36 @@ function j() {
24
24
  walkTokens: null
25
25
  };
26
26
  }
27
- var y = j();
28
- function ie(l) {
29
- y = l;
27
+ var S = G();
28
+ function ue(l) {
29
+ S = l;
30
30
  }
31
- var D = { exec: () => null };
32
- function B(l) {
31
+ var q = { exec: () => null };
32
+ function D(l) {
33
33
  let e = [];
34
34
  return (t) => {
35
- let n = Math.max(0, Math.min(3, t - 1)), s = e[n];
36
- return s || (s = l(n), e[n] = s), s;
35
+ let n = Math.max(0, Math.min(3, t - 1)), r = e[n];
36
+ return r || (r = l(n), e[n] = r), r;
37
37
  };
38
38
  }
39
- function h(l, e = "") {
39
+ function g(l, e = "") {
40
40
  let t = typeof l == "string" ? l : l.source, n = {
41
- replace: (s, i) => {
42
- let r = typeof i == "string" ? i : i.source;
43
- return r = r.replace(T.caret, "$1"), t = t.replace(s, r), n;
41
+ replace: (r, s) => {
42
+ let o = typeof s == "string" ? s : s.source;
43
+ return o = o.replace(O.caret, "$1"), t = t.replace(r, o), n;
44
44
  },
45
45
  getRegex: () => new RegExp(t, e)
46
46
  };
47
47
  return n;
48
48
  }
49
- var we = ((l = "") => {
49
+ var _e = ((l = "") => {
50
50
  try {
51
51
  return !!new RegExp("(?<=1)(?<!1)" + l);
52
52
  } catch {
53
53
  return !1;
54
54
  }
55
55
  })();
56
- var T = {
56
+ var O = {
57
57
  codeRemoveIndent: /^(?: {0,3}\t| {1,4})/gm,
58
58
  listInterruptsParagraph: /^ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/,
59
59
  outputLinkReplace: /\\([\[\]])/g,
@@ -73,7 +73,8 @@ var T = {
73
73
  blockquoteStart: /^ {0,3}>/,
74
74
  blockquoteSetextReplace: /\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,
75
75
  blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
76
- blockquoteMarkerWhitespace: /^( {0,3}>)([ \t]+)/gm,
76
+ blockquoteMarkerWhitespace: /^( {0,3}>)(\t[ \t]*)/gm,
77
+ nestedBlockMarker: /^ {0,3}(?:(?:[*+-]|\d{1,9}[.)])(?: |$)|> ?)/,
77
78
  listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
78
79
  listIsTask: /^\[[ xX]\][ \t]+\S/,
79
80
  listReplaceTask: /^\[[ xX]\][ \t]+/,
@@ -110,229 +111,230 @@ var T = {
110
111
  notSpaceStart: /^\S*/,
111
112
  endingNewline: /\n$/,
112
113
  listItemRegex: (l) => new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),
113
- nextBulletRegex: B((l) => new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
114
- hrRegex: B((l) => new RegExp(`^ {0,${l}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
115
- fencesBeginRegex: B((l) => new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),
116
- headingBeginRegex: B((l) => new RegExp(`^ {0,${l}}#{1,6}(?:\\s|$)`)),
117
- pedanticHeadingBeginRegex: B((l) => new RegExp(`^ {0,${l}}#`)),
118
- htmlBeginRegex: B((l) => new RegExp(`^ {0,${l}}(?:</?(?:${K})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")),
119
- blockquoteBeginRegex: B((l) => new RegExp(`^ {0,${l}}>`)),
114
+ nextBulletRegex: D((l) => new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
115
+ hrRegex: D((l) => new RegExp(`^ {0,${l}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
116
+ fencesBeginRegex: D((l) => new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),
117
+ headingBeginRegex: D((l) => new RegExp(`^ {0,${l}}#{1,6}(?:\\s|$)`)),
118
+ pedanticHeadingBeginRegex: D((l) => new RegExp(`^ {0,${l}}#`)),
119
+ htmlBeginRegex: D((l) => new RegExp(`^ {0,${l}}(?:</?(?:${he})(?:[ \\t]+|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")),
120
+ blockquoteBeginRegex: D((l) => new RegExp(`^ {0,${l}}>`)),
120
121
  nestedContainerMarkers: /^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/
121
122
  };
122
- var He = /^(?:[ \t]*(?:\n|$))+/;
123
- var je = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
124
- var Ge = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/;
125
- var W = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
126
- var Ne = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
127
- var ae = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
128
- var Pe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/;
129
- var ye = h(Pe).replace(/bull/g, ae).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
130
- var Fe = h(Pe).replace(/bull/g, ae).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
131
- var le = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/;
132
- var Qe = /^[^\n]+/;
133
- var ue = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/;
134
- var Ue = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ue).replace("title", /(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex();
135
- var We = h(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, ae).getRegex();
136
- var K = "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";
137
- var pe = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
138
- var Ke = h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", pe).replace("tag", K).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
139
- var Se = (l) => h(le).replace("hr", W).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", l).replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", K).getRegex();
140
- var Xe = Se(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/);
141
- var Ve = Se(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/);
142
- var ce = {
143
- blockquote: h(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace("paragraph", Ve).getRegex(),
144
- code: je,
145
- def: Ue,
146
- fences: Ge,
147
- heading: Ne,
148
- hr: W,
149
- html: Ke,
150
- lheading: ye,
151
- list: We,
152
- newline: He,
153
- paragraph: Xe,
154
- table: D,
155
- text: Qe
123
+ var Ge = /^(?:[ \t]*(?:\n|$))+/;
124
+ var Ne = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
125
+ var Fe = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/;
126
+ var V = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
127
+ var Qe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
128
+ var ce = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
129
+ var he = "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";
130
+ var J = g(" {0,3}(?:</?(?:tag)(?:[ \\t]+|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", he).getRegex();
131
+ var $e = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/;
132
+ var Le = g($e).replace(/bull/g, ce).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/\|table/g, "").replace(/html/g, J).getRegex();
133
+ var We = g($e).replace(/bull/g, ce).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).replace(/html/g, J).getRegex();
134
+ var de = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/;
135
+ var Ue = /^[^\n]+/;
136
+ var ge = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/;
137
+ var Ke = g(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<(?:\\.|[^\n<>\\])*>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ge).replace("title", /(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex();
138
+ var Xe = g(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, ce).getRegex();
139
+ var ke = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
140
+ var Ve = g("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*?[ \\t]*/?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", ke).replace("tag", he).replace("attribute", /[ \t]+[a-zA-Z:_][\w.:-]*(?:[ \t]*=[ \t]*"[^"\n]*"|[ \t]*=[ \t]*'[^'\n]*'|[ \t]*=[ \t]*[^\s"'=<>`]+)?/).getRegex();
141
+ var Ce = (l) => g(de).replace("hr", V).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", l).replace("html", J).getRegex();
142
+ var Je = Ce(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/);
143
+ var Ye = Ce(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/);
144
+ var fe = {
145
+ blockquote: g(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace("paragraph", Ye).getRegex(),
146
+ code: Ne,
147
+ def: Ke,
148
+ fences: Fe,
149
+ heading: Qe,
150
+ hr: V,
151
+ html: Ve,
152
+ lheading: Le,
153
+ list: Xe,
154
+ newline: Ge,
155
+ paragraph: Je,
156
+ table: q,
157
+ text: Ue
156
158
  };
157
- var Re = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", W).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", K).getRegex();
158
- var Ye = {
159
- ...ce,
160
- lheading: Fe,
161
- table: Re,
162
- paragraph: h(le).replace("hr", W).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Re).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", K).getRegex()
159
+ var Pe = g("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", V).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", J).getRegex();
160
+ var tt = {
161
+ ...fe,
162
+ lheading: We,
163
+ table: Pe,
164
+ paragraph: g(de).replace("hr", V).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Pe).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", J).getRegex()
163
165
  };
164
- var et = {
165
- ...ce,
166
- html: h(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace("comment", pe).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(),
166
+ var nt = {
167
+ ...fe,
168
+ html: g(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace("comment", ke).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(),
167
169
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
168
170
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
169
- fences: D,
171
+ fences: q,
170
172
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
171
- paragraph: h(le).replace("hr", W).replace("heading", ` *#{1,6} *[^
172
- ]`).replace("lheading", ye).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
173
+ paragraph: g(de).replace("hr", V).replace("heading", ` *#{1,6} *[^
174
+ ]`).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").replace("lheading", Le).getRegex()
173
175
  };
174
- var tt = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
175
- var nt = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
176
- var _e = /^( {2,}|\\)\n(?!\s*$)[ \t]*/;
177
- var rt = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
178
- var $ = /[\p{P}\p{S}]/u;
179
- var G = /[\s\p{P}\p{S}]/u;
180
- var X = /[^\s\p{P}\p{S}]/u;
181
- var st = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, G).getRegex();
182
- var it = /[\p{Pi}\p{Ps}"']/u;
183
- var $e = /(?!~)[\p{P}\p{S}]/u;
184
- var ot = /(?!~)[\s\p{P}\p{S}]/u;
185
- var at = /(?:[^\s\p{P}\p{S}]|~)/u;
186
- var lt = h(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", we ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
187
- var Le = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
188
- var ut = h(Le, "u").replace(/punct/g, $).getRegex();
189
- var pt = h(Le, "u").replace(/punct/g, $e).getRegex();
190
- var ht = h(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, it).replace(/punct/g, $).getRegex();
191
- var Ce = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
192
- var dt = h(Ce, "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, G).replace(/punct/g, $).getRegex();
193
- var gt = h(Ce, "gu").replace(/notPunctSpace/g, at).replace(/punctSpace/g, ot).replace(/punct/g, $e).getRegex();
194
- var ft = h("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, G).replace(/punct/g, $).getRegex();
195
- var mt = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, G).replace(/punct/g, $).getRegex();
196
- var bt = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, G).replace(/punct/g, $).getRegex();
197
- var Rt = h(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, $).getRegex();
198
- var Ot = h("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, G).replace(/punct/g, $).getRegex();
199
- var wt = h(/\\(punct)/, "gu").replace(/punct/g, $).getRegex();
200
- var Pt = h(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, $).getRegex();
201
- var yt = 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();
202
- var St = h(pe).replace("(?:-->|$)", "-->").getRegex();
203
- var _t = h("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", St).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
204
- var Ie = /\[(?:\\[\s\S]|[^\[\]\\])*\]/;
205
- var re = h(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", Ie).getRegex();
206
- var $t = h(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", re).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex();
207
- var Lt = h(/^!?\[(label)\]\[(ref)\]/).replace("label", re).replace("ref", ue).getRegex();
208
- var Ct = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", ue).getRegex();
209
- var Te = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/;
210
- var It = h(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", Ie).getRegex();
211
- var At = h("reflink|nolink(?!\\()", "g").replace("reflink", h(/^!?\[(label)\]\[(ref)\]/).replace("label", It).replace("ref", Te).getRegex()).replace("nolink", h(/^!?\[(ref)\](?:\[\])?/).replace("ref", Te).getRegex()).getRegex();
212
- var Oe = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
213
- var zt = h(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex();
214
- var he = {
215
- _backpedal: D,
216
- anyPunctuation: wt,
217
- anyPunctuationOutsideCode: Pt,
218
- autolink: yt,
219
- blockSkip: lt,
220
- br: _e,
221
- code: nt,
222
- del: D,
223
- delLDelim: D,
224
- delRDelim: D,
225
- emStrongLDelim: ut,
226
- emStrongRDelimAst: dt,
227
- emStrongRDelimUnd: mt,
228
- escape: tt,
229
- link: $t,
230
- nolink: Ct,
231
- punctuation: st,
232
- reflink: Lt,
233
- reflinkSearch: At,
234
- tag: _t,
235
- text: rt,
236
- url: D
237
- };
238
- var Mt = {
239
- ...he,
240
- emStrongLDelim: ht,
241
- emStrongRDelimAst: ft,
176
+ var rt = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
177
+ var st = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
178
+ var Ie = /^( {2,}|\\)\n(?!\s*$)[ \t]*/;
179
+ var it = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
180
+ var L = /[\p{P}\p{S}]/u;
181
+ var N = /[\s\p{P}\p{S}]/u;
182
+ var Y = /[^\s\p{P}\p{S}]/u;
183
+ var ot = g(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, N).getRegex();
184
+ var at = /[\p{Pi}\p{Ps}"']/u;
185
+ var Ae = /(?!~)[\p{P}\p{S}]/u;
186
+ var lt = /(?!~)[\s\p{P}\p{S}]/u;
187
+ var ut = /(?:[^\s\p{P}\p{S}]|~)/u;
188
+ var pt = g(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", _e ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
189
+ var Ee = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
190
+ var ct = g(Ee, "u").replace(/punct/g, L).getRegex();
191
+ var ht = g(Ee, "u").replace(/punct/g, Ae).getRegex();
192
+ var gt = g(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, at).replace(/punct/g, L).getRegex();
193
+ var ze = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
194
+ var kt = g(ze, "gu").replace(/notPunctSpace/g, Y).replace(/punctSpace/g, N).replace(/punct/g, L).getRegex();
195
+ var ft = g(ze, "gu").replace(/notPunctSpace/g, ut).replace(/punctSpace/g, lt).replace(/punct/g, Ae).getRegex();
196
+ var xt = g("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Y).replace(/punctSpace/g, N).replace(/punct/g, L).getRegex();
197
+ var bt = g("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Y).replace(/punctSpace/g, N).replace(/punct/g, L).getRegex();
198
+ var Tt = g("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Y).replace(/punctSpace/g, N).replace(/punct/g, L).getRegex();
199
+ var Ot = g(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, L).getRegex();
200
+ var Pt = g("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Y).replace(/punctSpace/g, N).replace(/punct/g, L).getRegex();
201
+ var yt = g(/\\(punct)/, "gu").replace(/punct/g, L).getRegex();
202
+ var St = g(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, L).getRegex();
203
+ var _t = g(/^<(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();
204
+ var $t = g(ke).replace("(?:-->|$)", "-->").getRegex();
205
+ var Lt = g("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", $t).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
206
+ var Me = /\[(?:\\[\s\S]|[^\[\]\\])*\]/;
207
+ var ie = g(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", Me).getRegex();
208
+ var Ct = g(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", ie).replace("href", /<(?:\\.|[^\n<>\\])*>|(?!<)[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex();
209
+ var It = g(/^!?\[(label)\]\[(ref)\]/).replace("label", ie).replace("ref", ge).getRegex();
210
+ var At = g(/^!?\[(ref)\](?:\[\])?/).replace("ref", ge).getRegex();
211
+ var ye = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/;
212
+ var Et = g(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", Me).getRegex();
213
+ var zt = g("reflink|nolink(?!\\()", "g").replace("reflink", g(/^!?\[(label)\]\[(ref)\]/).replace("label", Et).replace("ref", ye).getRegex()).replace("nolink", g(/^!?\[(ref)\](?:\[\])?/).replace("ref", ye).getRegex()).getRegex();
214
+ var Se = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
215
+ var Bt = g(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex();
216
+ var me = {
217
+ _backpedal: q,
218
+ anyPunctuation: yt,
219
+ anyPunctuationOutsideCode: St,
220
+ autolink: _t,
221
+ blockSkip: pt,
222
+ br: Ie,
223
+ code: st,
224
+ del: q,
225
+ delLDelim: q,
226
+ delRDelim: q,
227
+ emStrongLDelim: ct,
228
+ emStrongRDelimAst: kt,
242
229
  emStrongRDelimUnd: bt,
243
- link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", re).getRegex(),
244
- reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", re).getRegex()
230
+ escape: rt,
231
+ link: Ct,
232
+ nolink: At,
233
+ punctuation: ot,
234
+ reflink: It,
235
+ reflinkSearch: zt,
236
+ tag: Lt,
237
+ text: it,
238
+ url: q
245
239
  };
246
- var oe = {
247
- ...he,
248
- emStrongRDelimAst: gt,
249
- emStrongLDelim: pt,
250
- delLDelim: Rt,
251
- delRDelim: Ot,
252
- url: h(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", zt).replace("protocol", Oe).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
240
+ var Dt = {
241
+ ...me,
242
+ emStrongLDelim: gt,
243
+ emStrongRDelimAst: xt,
244
+ emStrongRDelimUnd: Tt,
245
+ link: g(/^!?\[(label)\]\((.*?)\)/).replace("label", ie).getRegex(),
246
+ reflink: g(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", ie).getRegex()
247
+ };
248
+ var pe = {
249
+ ...me,
250
+ emStrongRDelimAst: ft,
251
+ emStrongLDelim: ht,
252
+ delLDelim: Ot,
253
+ delRDelim: Pt,
254
+ url: g(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", Bt).replace("protocol", Se).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
253
255
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
254
256
  del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
255
- text: h(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", Oe).replace(/emailProtocol/g, /(?:mailto|xmpp):/).replace("wwwStart", we ? "(?<![^\\s*_~(])www\\." : "www\\.").getRegex()
257
+ text: g(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", Se).replace(/emailProtocol/g, /(?:mailto|xmpp):/).replace("wwwStart", _e ? "(?<![^\\s*_~(])www\\." : "www\\.").getRegex()
256
258
  };
257
- var Bt = {
258
- ...oe,
259
- br: h(_e).replace("{2,}", "*").getRegex(),
260
- text: h(oe.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
259
+ var qt = {
260
+ ...pe,
261
+ br: g(Ie).replace("{2,}", "*").getRegex(),
262
+ text: g(pe.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
261
263
  };
262
- var V = {
263
- normal: ce,
264
- gfm: Ye,
265
- pedantic: et
264
+ var ee = {
265
+ normal: fe,
266
+ gfm: tt,
267
+ pedantic: nt
266
268
  };
267
- var N = {
268
- normal: he,
269
- gfm: oe,
270
- breaks: Bt,
271
- pedantic: Mt
269
+ var F = {
270
+ normal: me,
271
+ gfm: pe,
272
+ breaks: qt,
273
+ pedantic: Dt
272
274
  };
273
- var Dt = {
275
+ var vt = {
274
276
  "&": "&amp;",
275
277
  "<": "&lt;",
276
278
  ">": "&gt;",
277
279
  "\"": "&quot;",
278
280
  "'": "&#39;"
279
281
  };
280
- var Ae = (l) => Dt[l];
281
- function P(l, e) {
282
+ var Be = (l) => vt[l];
283
+ function y(l, e) {
282
284
  if (e) {
283
- if (T.escapeTest.test(l)) return l.replace(T.escapeReplace, Ae);
284
- } else if (T.escapeTestNoEncode.test(l)) return l.replace(T.escapeReplaceNoEncode, Ae);
285
+ if (O.escapeTest.test(l)) return l.replace(O.escapeReplace, Be);
286
+ } else if (O.escapeTestNoEncode.test(l)) return l.replace(O.escapeReplaceNoEncode, Be);
285
287
  return l;
286
288
  }
287
- function Ee(l) {
288
- return T.numericCharacterReference.test(l) ? l.replace(T.numericCharacterReferenceOrAmpersand, (e, t, n) => {
289
+ function De(l) {
290
+ return O.numericCharacterReference.test(l) ? l.replace(O.numericCharacterReferenceOrAmpersand, (e, t, n) => {
289
291
  if (t === void 0 && n === void 0) return "&amp;";
290
- let s = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
291
- return s === 0 || s > 1114111 || s >= 55296 && s <= 57343 ? "�" : s === 38 ? "&amp;" : String.fromCodePoint(s);
292
+ let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
293
+ return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : r === 38 ? "&amp;" : String.fromCodePoint(r);
292
294
  }) : l;
293
295
  }
294
- function de(l) {
296
+ function xe(l) {
295
297
  try {
296
- l = encodeURI(l).replace(T.percentDecode, "%");
298
+ l = encodeURI(l).replace(O.percentDecode, "%");
297
299
  } catch {
298
300
  return null;
299
301
  }
300
302
  return l;
301
303
  }
302
- function ge(l, e) {
303
- let n = l.replace(T.findPipe, (i, r, o) => {
304
- let a = !1, p = r;
305
- for (; --p >= 0 && o[p] === "\\";) a = !a;
304
+ function be(l, e) {
305
+ let n = l.replace(O.findPipe, (s, o, i) => {
306
+ let a = !1, c = o;
307
+ for (; --c >= 0 && i[c] === "\\";) a = !a;
306
308
  return a ? "|" : " |";
307
- }).split(T.splitPipe), s = 0;
309
+ }).split(O.splitPipe), r = 0;
308
310
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
309
311
  else for (; n.length < e;) n.push("");
310
- for (; s < n.length; s++) n[s] = n[s].trim().replace(T.slashPipe, "|");
312
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(O.slashPipe, "|");
311
313
  return n;
312
314
  }
313
- function L(l, e, t) {
315
+ function C(l, e, t) {
314
316
  let n = l.length;
315
317
  if (n === 0) return "";
316
- let s = 0;
317
- for (; s < n;) {
318
- let i = l.charAt(n - s - 1);
319
- if (i === e && !t) s++;
320
- else if (i !== e && t) s++;
318
+ let r = 0;
319
+ for (; r < n;) {
320
+ let s = l.charAt(n - r - 1);
321
+ if (s === e && !t) r++;
322
+ else if (s !== e && t) r++;
321
323
  else break;
322
324
  }
323
- return l.slice(0, n - s);
325
+ return l.slice(0, n - r);
324
326
  }
325
- function ke(l) {
327
+ function Re(l) {
326
328
  let e = l.split(`
327
329
  `), t = e.length - 1;
328
- for (; t >= 0 && T.blankLine.test(e[t]);) t--;
330
+ for (; t >= 0 && O.blankLine.test(e[t]);) t--;
329
331
  return e.length - t <= 2 ? l : e.slice(0, t + 1).join(`
330
332
  `);
331
333
  }
332
- function Q(l) {
333
- return l.trim().replace(T.multipleSpaceGlobal, " ").toLowerCase().toUpperCase().toLowerCase();
334
+ function W(l) {
335
+ return l.trim().replace(O.multipleSpaceGlobal, " ").toLowerCase().toUpperCase().toLowerCase();
334
336
  }
335
- function fe(l, e) {
337
+ function Te(l, e) {
336
338
  if (l.indexOf(e[0]) === -1 && l.indexOf(e[1]) === -1) return -1;
337
339
  let t = 0;
338
340
  for (let n = 0; n < l.length; n++) if (l[n] === "\\") n++;
@@ -340,20 +342,20 @@ function fe(l, e) {
340
342
  else if (l[n] === e[1] && (t--, t < 0)) return n;
341
343
  return t > 0 ? -2 : -1;
342
344
  }
343
- var F = /* @__PURE__ */ new WeakMap();
344
- function me(l) {
345
+ var Q = /* @__PURE__ */ new WeakMap();
346
+ function Oe(l) {
345
347
  let e = {
346
348
  "*": -1,
347
349
  _: -1
348
350
  }, t = -1, n = l.length;
349
- for (let s = 0; s < n; s++) {
350
- let i = l[s];
351
- if (i !== "*" && i !== "_" && i !== "~") continue;
352
- let r = s === 0 ? `
353
- ` : l[s - 1], o = s + 1;
354
- for (; o < n && l[o] === i;) o++;
355
- r !== " " && r !== " " && r !== `
356
- ` && r !== "\r" && r !== "\f" && (i === "~" ? t = s : e[i] = s), s = o - 1;
351
+ for (let r = 0; r < n; r++) {
352
+ let s = l[r];
353
+ if (s !== "*" && s !== "_" && s !== "~") continue;
354
+ let o = r === 0 ? `
355
+ ` : l[r - 1], i = r + 1;
356
+ for (; i < n && l[i] === s;) i++;
357
+ o !== " " && o !== " " && o !== `
358
+ ` && o !== "\r" && o !== "\f" && (s === "~" ? t = r : e[s] = r), r = i - 1;
357
359
  }
358
360
  return {
359
361
  maskedSrc: l,
@@ -361,37 +363,55 @@ function me(l) {
361
363
  lastPossibleDelCloserIndex: t
362
364
  };
363
365
  }
364
- function ze(l, e) {
365
- let t = me(e), n = F.get(l);
366
- n ? n.push(t) : F.set(l, [t]);
366
+ function qe(l, e) {
367
+ let t = Oe(e), n = Q.get(l);
368
+ n ? n.push(t) : Q.set(l, [t]);
367
369
  }
368
- function Me(l) {
369
- let e = F.get(l);
370
- e && (e.pop(), e.length === 0 && F.delete(l));
370
+ function ve(l) {
371
+ let e = Q.get(l);
372
+ e && (e.pop(), e.length === 0 && Q.delete(l));
371
373
  }
372
- function Be(l, e, t) {
373
- let n = F.get(l)?.at(-1);
374
- return n && n.maskedSrc === e ? n.lastPossibleEmStrongCloserIndex[t] : me(e).lastPossibleEmStrongCloserIndex[t];
374
+ function oe(l, e, t) {
375
+ let n = Q.get(l)?.at(-1);
376
+ return n && n.maskedSrc === e ? n.lastPossibleEmStrongCloserIndex[t] : Oe(e).lastPossibleEmStrongCloserIndex[t];
375
377
  }
376
- function De(l, e) {
377
- let t = F.get(l)?.at(-1);
378
- return t && t.maskedSrc === e ? t.lastPossibleDelCloserIndex : me(e).lastPossibleDelCloserIndex;
378
+ function ae(l, e) {
379
+ let t = Q.get(l)?.at(-1);
380
+ return t && t.maskedSrc === e ? t.lastPossibleDelCloserIndex : Oe(e).lastPossibleDelCloserIndex;
379
381
  }
380
- function J(l, e = 0) {
382
+ function te(l, e = 0) {
381
383
  let t = e, n = "";
382
- for (let s of l) if (s === " ") {
383
- let i = 4 - t % 4;
384
- n += " ".repeat(i), t += i;
385
- } else n += s, t++;
384
+ for (let r of l) if (r === " ") {
385
+ let s = 4 - t % 4;
386
+ n += " ".repeat(s), t += s;
387
+ } else n += r, t++;
386
388
  return n;
387
389
  }
388
- function qe(l, e, t, n, s) {
389
- let i = e.href, r = e.title || null, o = l[1].replace(s.other.outputLinkReplace, "$1"), a = l[0].charAt(0) === "!", p = n.state.inLink, c = n.state.linkEmitted, u = n.state.inRawBlock;
390
+ function Ht(l, e) {
391
+ let t = "";
392
+ for (let n = 0; n < l.length; n++) {
393
+ if (l[n] === "`") {
394
+ let r = e.inline.code.exec(l.slice(n));
395
+ if (r) {
396
+ t += r[0], n += r[0].length - 1;
397
+ continue;
398
+ }
399
+ }
400
+ if (l[n] === "\\" && (l[n + 1] === "[" || l[n + 1] === "]")) {
401
+ t += l[n + 1], n++;
402
+ continue;
403
+ }
404
+ t += l[n];
405
+ }
406
+ return t;
407
+ }
408
+ function He(l, e, t, n, r) {
409
+ let s = e.href, o = e.title || null, i = Ht(l[1], r), a = l[0].charAt(0) === "!", c = n.state.inLink, u = n.state.linkEmitted, d = n.state.inRawBlock;
390
410
  n.state.inLink = !0, n.state.linkEmitted = !1;
391
- let d = n.inlineTokens(o), k = n.state.linkEmitted;
392
- if (n.state.linkEmitted = c, n.state.inLink = p, !a) {
393
- if (k) {
394
- n.state.inRawBlock = u;
411
+ let h = n.inlineTokens(i), p = n.state.linkEmitted;
412
+ if (n.state.linkEmitted = u, n.state.inLink = c, !a) {
413
+ if (p) {
414
+ n.state.inRawBlock = d;
395
415
  return;
396
416
  }
397
417
  n.state.linkEmitted = !0;
@@ -399,44 +419,44 @@ function qe(l, e, t, n, s) {
399
419
  return {
400
420
  type: a ? "image" : "link",
401
421
  raw: t,
402
- href: i,
403
- title: r,
404
- text: o,
405
- tokens: d
422
+ href: s,
423
+ title: o,
424
+ text: i,
425
+ tokens: h
406
426
  };
407
427
  }
408
- function qt(l, e, t) {
428
+ function Zt(l, e, t) {
409
429
  let n = l.match(t.other.indentCodeCompensation);
410
430
  if (n === null) return e;
411
- let s = n[1];
431
+ let r = n[1];
412
432
  return e.split(`
413
- `).map((i) => {
414
- let r = i.match(t.other.beginningSpace);
415
- if (r === null) return i;
416
- let [o] = r;
417
- return i.slice(Math.min(o.length, s.length));
433
+ `).map((s) => {
434
+ let o = s.match(t.other.beginningSpace);
435
+ if (o === null) return s;
436
+ let [i] = o;
437
+ return s.slice(Math.min(i.length, r.length));
418
438
  }).join(`
419
439
  `);
420
440
  }
421
- function ve(l, e, t, n) {
441
+ function Ze(l, e, t, n) {
422
442
  if (!e.includes("<")) return !1;
423
- for (let s = 0; s < e.length; s++) {
424
- if (e[s] === "\\") {
425
- s++;
443
+ for (let r = 0; r < e.length; r++) {
444
+ if (e[r] === "\\") {
445
+ r++;
426
446
  continue;
427
447
  }
428
- if (e[s] === "`") {
429
- let o = n.inline.code.exec(e.slice(s));
430
- if (o) {
431
- s += o[0].length - 1;
448
+ if (e[r] === "`") {
449
+ let i = n.inline.code.exec(e.slice(r));
450
+ if (i) {
451
+ r += i[0].length - 1;
432
452
  continue;
433
453
  }
434
454
  }
435
- if (e[s] !== "<") continue;
436
- let i = l.slice(t + s), r = n.inline.tag.exec(i) || n.inline.autolink.exec(i);
437
- if (r) {
438
- if (r[0].length > e.length - s) return !0;
439
- s += r[0].length - 1;
455
+ if (e[r] !== "<") continue;
456
+ let s = l.slice(t + r), o = n.inline.tag.exec(s) || n.inline.autolink.exec(s);
457
+ if (o) {
458
+ if (o[0].length > e.length - r) return !0;
459
+ r += o[0].length - 1;
440
460
  }
441
461
  }
442
462
  return !1;
@@ -446,7 +466,7 @@ var _ = class {
446
466
  rules;
447
467
  lexer;
448
468
  constructor(e) {
449
- this.options = e || y;
469
+ this.options = e || S;
450
470
  }
451
471
  space(e) {
452
472
  let t = this.rules.block.newline.exec(e);
@@ -458,7 +478,7 @@ var _ = class {
458
478
  code(e) {
459
479
  let t = this.rules.block.code.exec(e);
460
480
  if (t) {
461
- let n = this.options.pedantic ? t[0] : ke(t[0]);
481
+ let n = this.options.pedantic ? t[0] : Re(t[0]);
462
482
  return {
463
483
  type: "code",
464
484
  raw: n,
@@ -470,12 +490,14 @@ var _ = class {
470
490
  fences(e) {
471
491
  let t = this.rules.block.fences.exec(e);
472
492
  if (t) {
473
- let n = t[0], s = qt(n, t[3] || "", this.rules);
474
- return {
493
+ let n = t[0], r = Zt(n, t[3] || "", this.rules);
494
+ return t[3] !== void 0 && (r === "" || r.endsWith(`
495
+ `)) && (r += `
496
+ `), {
475
497
  type: "code",
476
498
  raw: n,
477
499
  lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
478
- text: s
500
+ text: r
479
501
  };
480
502
  }
481
503
  }
@@ -484,12 +506,12 @@ var _ = class {
484
506
  if (t) {
485
507
  let n = t[2].trim();
486
508
  if (this.rules.other.endingHash.test(n)) {
487
- let s = L(n, "#");
488
- (this.options.pedantic || !s || this.rules.other.endingSpaceTabChar.test(s)) && (n = s.trim());
509
+ let r = C(n, "#");
510
+ (this.options.pedantic || !r || this.rules.other.endingSpaceTabChar.test(r)) && (n = r.trim());
489
511
  }
490
512
  return {
491
513
  type: "heading",
492
- raw: L(t[0], `
514
+ raw: C(t[0], `
493
515
  `),
494
516
  depth: t[1].length,
495
517
  text: n,
@@ -501,66 +523,66 @@ var _ = class {
501
523
  let t = this.rules.block.hr.exec(e);
502
524
  if (t) return {
503
525
  type: "hr",
504
- raw: L(t[0], `
526
+ raw: C(t[0], `
505
527
  `)
506
528
  };
507
529
  }
508
530
  blockquote(e) {
509
531
  let t = this.rules.block.blockquote.exec(e);
510
532
  if (t) {
511
- let n = L(t[0], `
533
+ let n = C(t[0], `
512
534
  `).split(`
513
- `), s = "", i = "", r = [];
535
+ `), r = "", s = "", o = [];
514
536
  for (; n.length > 0;) {
515
- let o = !1, a = [], p = 0;
516
- for (; p < n.length; p++) if (this.rules.other.blockquoteStart.test(n[p])) a.push(n[p]), o = !0;
517
- else if (!o) a.push(n[p]);
537
+ let i = !1, a = [], c = 0;
538
+ for (; c < n.length; c++) if (this.rules.other.blockquoteStart.test(n[c])) a.push(n[c]), i = !0;
539
+ else if (!i) a.push(n[c]);
518
540
  else break;
519
- n = n.slice(p);
520
- let c = a.join(`
521
- `), u = c.replace(this.rules.other.blockquoteMarkerWhitespace, (g, b, f) => b + J(f, b.length)).replace(this.rules.other.blockquoteSetextReplace, `
541
+ n = n.slice(c);
542
+ let u = a.join(`
543
+ `), d = u.replace(this.rules.other.blockquoteMarkerWhitespace, (k, m, b) => b.startsWith(" ") ? m + " " + b.slice(1) : m + te(b, m.length)).replace(this.rules.other.blockquoteSetextReplace, `
522
544
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
523
- s = s ? `${s}
524
- ${c}` : c, i = i ? `${i}
525
- ${u}` : u;
526
- let d = this.lexer.state.top;
527
- if (this.lexer.state.top = !0, this.lexer.blockTokens(u, r, !0), this.lexer.state.top = d, n.length === 0) break;
528
- let k = r.at(-1);
529
- if (k?.type === "code" || k?.type === "heading" || k?.type === "hr" || k?.type === "html" || k?.type === "table") break;
530
- if (k?.type === "blockquote") {
531
- let g = k, b = n.join(`
532
- `), f = g.raw + `
533
- ` + b.replace(this.rules.other.blockquoteSetextReplace2, ""), m = this.blockquote(f);
534
- r[r.length - 1] = m;
535
- let S = f.substring(m.raw.length).replace(/^\n/, ""), R = S ? S.split(`
536
- `).length : 0, A = R ? n.slice(0, -R) : n;
537
- if (A.length > 0 && (s = `${s}
538
- ${A.join(`
539
- `)}`), i = i.substring(0, i.length - g.text.length) + m.text, n = n.slice(A.length), n.length > 0 && this.rules.other.blockquoteStart.test(n[0])) continue;
545
+ r = r ? `${r}
546
+ ${u}` : u, s = s ? `${s}
547
+ ${d}` : d;
548
+ let h = this.lexer.state.top;
549
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(d, o, !0), this.lexer.state.top = h, n.length === 0) break;
550
+ let p = o.at(-1);
551
+ if (p?.type === "code" || p?.type === "heading" || p?.type === "hr" || p?.type === "html" || p?.type === "table") break;
552
+ if (p?.type === "blockquote") {
553
+ let k = p, m = n.join(`
554
+ `), b = k.raw + `
555
+ ` + m.replace(this.rules.other.blockquoteSetextReplace2, ""), f = this.blockquote(b);
556
+ o[o.length - 1] = f;
557
+ let R = b.substring(f.raw.length).replace(/^\n/, ""), E = R ? R.split(`
558
+ `).length : 0, T = E ? n.slice(0, -E) : n;
559
+ if (T.length > 0 && (r = `${r}
560
+ ${T.join(`
561
+ `)}`), s = s.substring(0, s.length - k.text.length) + f.text, n = n.slice(T.length), n.length > 0 && this.rules.other.blockquoteStart.test(n[0])) continue;
540
562
  break;
541
- } else if (k?.type === "list") {
542
- let g = k, b = g.raw + `
563
+ } else if (p?.type === "list") {
564
+ let k = p, m = k.raw + `
543
565
  ` + n.join(`
544
- `), f = this.list(b);
545
- r[r.length - 1] = f;
546
- let m = f.raw.length > g.raw.length ? b.slice(g.raw.length + 1, f.raw.length).split(`
566
+ `), b = this.list(m);
567
+ o[o.length - 1] = b;
568
+ let f = b.raw.length > k.raw.length ? m.slice(k.raw.length + 1, b.raw.length).split(`
547
569
  `).length : 0;
548
- if (m > 0) {
549
- let S = n.slice(0, m).join(`
570
+ if (f > 0) {
571
+ let R = n.slice(0, f).join(`
550
572
  `);
551
- s = `${s}
552
- ${S}`, i = `${i}
553
- ${S}`;
573
+ r = `${r}
574
+ ${R}`, s = `${s}
575
+ ${R}`;
554
576
  }
555
- n = n.slice(m);
577
+ if (n = n.slice(f), n.length > 0 && !this.rules.other.blockquoteStart.test(n[0])) break;
556
578
  continue;
557
579
  }
558
580
  }
559
581
  return {
560
582
  type: "blockquote",
561
- raw: s,
562
- tokens: r,
563
- text: i
583
+ raw: r,
584
+ tokens: o,
585
+ text: s
564
586
  };
565
587
  }
566
588
  }
@@ -568,99 +590,110 @@ ${S}`;
568
590
  let t = this.rules.block.list.exec(e);
569
591
  if (t) {
570
592
  if (!this.options.pedantic && this.lexer.state.lastToken?.type === "text" && !this.rules.other.listInterruptsParagraph.test(e)) return;
571
- let n = e, s = () => n.length - e.length, i = t[1].trim(), r = i.length > 1, o = {
593
+ let n = e, r = () => n.length - e.length, s = t[1].trim(), o = s.length > 1, i = {
572
594
  type: "list",
573
595
  raw: "",
574
- ordered: r,
575
- start: r ? +i.slice(0, -1) : "",
596
+ ordered: o,
597
+ start: o ? +s.slice(0, -1) : "",
576
598
  loose: !1,
577
599
  items: []
578
600
  };
579
- i = r ? `\\d{1,9}\\${i.slice(-1)}` : `\\${i}`, this.options.pedantic && (i = r ? i : "[*+-]");
580
- let a = this.rules.other.listItemRegex(i), p = !1;
601
+ s = o ? `\\d{1,9}\\${s.slice(-1)}` : `\\${s}`, this.options.pedantic && (s = o ? s : "[*+-]");
602
+ let a = this.rules.other.listItemRegex(s), c = !1;
581
603
  for (; e;) {
582
- let u = !1, d = "";
604
+ let h = !1, p = "";
583
605
  if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
584
- let k = s();
606
+ let k = r();
585
607
  e = e.substring(t[0].length);
586
- let g = t[2].split(`
587
- `, 1)[0], b = t[1].length, f = this.options.pedantic ? J(g, b) : g.replace(this.rules.other.leadingSpaceTab, (v) => J(v, b)), m = e.split(`
588
- `, 1)[0], S = !f.trim(), R = 0;
589
- if (this.options.pedantic ? (R = 2, d = f.trimStart()) : S ? R = b + 1 : (R = f.search(this.rules.other.nonSpaceChar), R = R > 4 ? 1 : R, d = f.slice(R), R += b), S && this.rules.other.blankLine.test(m) && (e = e.substring(m.length + 1), u = !0), !u) {
590
- let v = this.rules.other.nextBulletRegex(R), U = this.rules.other.hrRegex(R), ee = this.rules.other.fencesBeginRegex(R), te = this.options.pedantic ? this.rules.other.pedanticHeadingBeginRegex(R) : this.rules.other.headingBeginRegex(R), M = this.rules.other.htmlBeginRegex(R), ne = this.rules.other.blockquoteBeginRegex(R), Z = !1;
608
+ let m = t[2].split(`
609
+ `, 1)[0], b = t[1].length, f = this.options.pedantic ? te(m, b) : m.replace(this.rules.other.leadingSpaceTab, (H) => te(H, b)), R = e.split(`
610
+ `, 1)[0], E = !f.trim(), T = 0;
611
+ if (this.options.pedantic ? (T = 2, p = f.trimStart()) : E ? T = b + 1 : (T = f.search(this.rules.other.nonSpaceChar), T = T > 4 ? 1 : T, p = f.slice(T), T += b), E && this.rules.other.blankLine.test(R) && (e = e.substring(R.length + 1), h = !0), !h) {
612
+ let H = this.rules.other.nextBulletRegex(T), K = this.rules.other.hrRegex(T), re = this.rules.other.fencesBeginRegex(T), B = this.options.pedantic ? this.rules.other.pedanticHeadingBeginRegex(T) : this.rules.other.headingBeginRegex(T), X = this.rules.other.htmlBeginRegex(T), se = this.rules.other.blockquoteBeginRegex(T), le = !1;
591
613
  for (; e;) {
592
- let xe = e.split(`
593
- `, 1)[0], H;
594
- if (m = xe, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), H = m) : H = m.replace(this.rules.other.leadingSpaceTab, (be) => J(be)), ee.test(m) || te.test(m) || M.test(m) || ne.test(m) || v.test(m) || U.test(m)) break;
595
- if (H.search(this.rules.other.nonSpaceChar) >= R || !m.trim()) d += `
596
- ` + H.slice(R), Z = !1;
614
+ let we = e.split(`
615
+ `, 1)[0], Z;
616
+ if (R = we, this.options.pedantic ? (R = R.replace(this.rules.other.listReplaceNesting, " "), Z = R) : Z = R.replace(this.rules.other.leadingSpaceTab, ($) => te($)), re.test(R) || B.test(R) || X.test(R) || se.test(R) || H.test(R) || K.test(R)) break;
617
+ if (Z.search(this.rules.other.nonSpaceChar) >= T || !R.trim()) p += `
618
+ ` + Z.slice(T), le = !1;
597
619
  else {
598
- if (S || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ee.test(f) || te.test(f) || M.test(f) || U.test(f)) break;
599
- if (!this.options.pedantic && !Z) {
600
- let se = f.replace(this.rules.other.nestedContainerMarkers, "");
601
- if (this.rules.block.fences.test(se) || this.rules.block.heading.test(se) || this.rules.block.hr.test(se)) break;
620
+ if (E) break;
621
+ let $ = f;
622
+ if (!this.options.pedantic && !p.includes(`
623
+ `) && !f.includes(" ")) {
624
+ let j;
625
+ for (; !K.test($) && (j = this.rules.other.nestedBlockMarker.exec($));) $ = $.slice(j[0].length);
626
+ if (!$.trim()) break;
627
+ }
628
+ if ($.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || re.test($) || B.test($) || X.test($) || K.test($)) break;
629
+ if (!this.options.pedantic && !le) {
630
+ let j = f.replace(this.rules.other.nestedContainerMarkers, "");
631
+ if (this.rules.block.fences.test(j) || this.rules.block.heading.test(j) || this.rules.block.hr.test(j)) break;
602
632
  }
603
- let Ze = !this.options.pedantic && /^ {0,3}(?:=+|-+) *$/.test(m) && this.rules.block.lheading.test(`${f}
604
- ${m}`) ? ` ${H.replace(/^ {0,3}/, "")}` : m;
605
- d += `
606
- ` + Ze, Z = !0;
633
+ let je = !this.options.pedantic && /^ {0,3}(?:=+|-+) *$/.test(R) && this.rules.block.lheading.test(`${f}
634
+ ${R}`) ? ` ${Z.replace(/^ {0,3}/, "")}` : R;
635
+ p += `
636
+ ` + je, le = !0;
607
637
  }
608
- S = !m.trim(), e = e.substring(xe.length + 1), f = H.slice(R);
638
+ E = !R.trim(), e = e.substring(we.length + 1), f = Z.slice(T);
609
639
  }
610
640
  }
611
- let A = n.slice(k, s());
612
- o.loose || (p ? o.loose = !0 : this.rules.other.doubleBlankLine.test(A) && (p = !0)), o.items.push({
641
+ let U = n.slice(k, r());
642
+ i.loose || (c ? i.loose = !0 : this.rules.other.doubleBlankLine.test(U) && (c = !0)), i.items.push({
613
643
  type: "list_item",
614
- raw: A,
615
- task: !!this.options.gfm && this.rules.other.listIsTask.test(d),
644
+ raw: U,
645
+ task: !!this.options.gfm && this.rules.other.listIsTask.test(p),
616
646
  loose: !1,
617
- text: d,
647
+ text: p,
618
648
  tokens: []
619
649
  });
620
650
  }
621
- let c = o.items.at(-1);
622
- if (c) c.raw = c.raw.trimEnd(), c.text = c.text.trimEnd();
651
+ let u = i.items.at(-1);
652
+ if (u) u.raw = u.raw.trimEnd(), u.text = u.text.trimEnd();
623
653
  else return;
624
- o.raw = n.slice(0, s()).trimEnd();
625
- for (let u of o.items) if (this.lexer.state.top = !1, u.tokens = this.lexer.blockTokens(u.text, []), !o.loose) {
626
- let d = u.tokens.filter((g) => g.type === "space");
627
- o.loose = d.length > 0 && d.some((g) => this.rules.other.anyLine.test(g.raw));
654
+ i.raw = n.slice(0, r()).trimEnd();
655
+ let d = [];
656
+ for (let h of i.items) if (this.lexer.state.top = !1, d.push(this.lexer.inlineQueue.length), h.tokens = this.lexer.blockTokens(h.text, []), !i.loose) {
657
+ let p = h.tokens.filter((m) => m.type === "space");
658
+ i.loose = p.length > 0 && p.some((m) => this.rules.other.anyLine.test(m.raw));
628
659
  }
629
- for (let u of o.items) {
630
- let d = u.tokens[0];
631
- if (u.task && (d?.type === "text" || d?.type === "paragraph")) {
632
- u.text = u.text.replace(this.rules.other.listReplaceTask, ""), d.raw = d.raw.replace(this.rules.other.listReplaceTask, ""), d.text = d.text.replace(this.rules.other.listReplaceTask, "");
633
- for (let g = this.lexer.inlineQueue.length - 1; g >= 0; g--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[g].src)) {
634
- this.lexer.inlineQueue[g].src = this.lexer.inlineQueue[g].src.replace(this.rules.other.listReplaceTask, "");
660
+ for (let h = 0; h < i.items.length; h++) {
661
+ let p = i.items[h], k = p.tokens[0];
662
+ if (p.task && (k?.type === "text" || k?.type === "paragraph")) {
663
+ p.text = p.text.replace(this.rules.other.listReplaceTask, ""), k.raw = k.raw.replace(this.rules.other.listReplaceTask, ""), k.text = k.text.replace(this.rules.other.listReplaceTask, "");
664
+ let m = this.lexer.inlineQueue;
665
+ for (let f = d[h]; f < m.length; f++) if (m[f].tokens === k.tokens) {
666
+ m[f].src = m[f].src.replace(this.rules.other.listReplaceTask, "");
635
667
  break;
636
668
  }
637
- let k = this.rules.other.listTaskCheckbox.exec(u.raw);
638
- if (k) {
639
- let g = {
669
+ let b = this.rules.other.listTaskCheckbox.exec(p.raw);
670
+ if (b) {
671
+ let f = {
640
672
  type: "checkbox",
641
- raw: k[0] + " ",
642
- checked: k[0] !== "[ ]"
673
+ raw: b[0] + " ",
674
+ checked: b[0] !== "[ ]"
643
675
  };
644
- u.checked = g.checked, o.loose ? u.tokens[0] && ["paragraph", "text"].includes(u.tokens[0].type) && "tokens" in u.tokens[0] && u.tokens[0].tokens ? (u.tokens[0].raw = g.raw + u.tokens[0].raw, u.tokens[0].text = g.raw + u.tokens[0].text, u.tokens[0].tokens.unshift(g)) : u.tokens.unshift({
676
+ p.checked = f.checked, i.loose ? p.tokens[0] && ["paragraph", "text"].includes(p.tokens[0].type) && "tokens" in p.tokens[0] && p.tokens[0].tokens ? (p.tokens[0].raw = f.raw + p.tokens[0].raw, p.tokens[0].text = f.raw + p.tokens[0].text, p.tokens[0].tokens.unshift(f)) : p.tokens.unshift({
645
677
  type: "paragraph",
646
- raw: g.raw,
647
- text: g.raw,
648
- tokens: [g]
649
- }) : u.tokens.unshift(g);
678
+ raw: f.raw,
679
+ text: f.raw,
680
+ tokens: [f]
681
+ }) : p.tokens.unshift(f);
650
682
  }
651
- } else u.task && (u.task = !1);
683
+ } else p.task && (p.task = !1);
652
684
  }
653
- if (o.loose) for (let u of o.items) {
654
- u.loose = !0;
655
- for (let d of u.tokens) d.type === "text" && (d.type = "paragraph");
685
+ if (i.loose) for (let h of i.items) {
686
+ h.loose = !0;
687
+ for (let p of h.tokens) p.type === "text" && (p.type = "paragraph");
656
688
  }
657
- return o;
689
+ return i;
658
690
  }
659
691
  }
660
692
  html(e) {
661
693
  let t = this.rules.block.html.exec(e);
662
694
  if (t) {
663
- let n = ke(t[0]);
695
+ if (this.lexer.state.lastToken?.type === "paragraph" && !this.rules.other.htmlBeginRegex(4).test(e)) return;
696
+ let n = Re(t[0]);
664
697
  return {
665
698
  type: "html",
666
699
  block: !0,
@@ -673,45 +706,45 @@ ${m}`) ? ` ${H.replace(/^ {0,3}/, "")}` : m;
673
706
  def(e) {
674
707
  let t = this.rules.block.def.exec(e);
675
708
  if (t) {
676
- if (!this.rules.other.startAngleBracket.test(t[2]) && fe(t[2], "()") !== -1) return;
677
- let n = Q(t[1]), s = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", i = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
709
+ if (!this.rules.other.startAngleBracket.test(t[2]) && Te(t[2], "()") !== -1) return;
710
+ let n = W(t[1]), r = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", s = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
678
711
  return {
679
712
  type: "def",
680
713
  tag: n,
681
- raw: L(t[0], `
714
+ raw: C(t[0], `
682
715
  `),
683
- href: s,
684
- title: i
716
+ href: r,
717
+ title: s
685
718
  };
686
719
  }
687
720
  }
688
721
  table(e) {
689
722
  let t = this.rules.block.table.exec(e);
690
723
  if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
691
- let n = ge(t[1]), s = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
692
- `) : [], r = {
724
+ let n = be(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
725
+ `) : [], o = {
693
726
  type: "table",
694
- raw: L(t[0], `
727
+ raw: C(t[0], `
695
728
  `),
696
729
  header: [],
697
730
  align: [],
698
731
  rows: []
699
732
  };
700
- if (n.length === s.length) {
701
- 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);
702
- for (let o = 0; o < n.length; o++) r.header.push({
703
- text: n[o],
704
- tokens: this.lexer.inline(n[o]),
733
+ if (n.length === r.length) {
734
+ for (let i of r) this.rules.other.tableAlignRight.test(i) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(i) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(i) ? o.align.push("left") : o.align.push(null);
735
+ for (let i = 0; i < n.length; i++) o.header.push({
736
+ text: n[i],
737
+ tokens: this.lexer.inline(n[i]),
705
738
  header: !0,
706
- align: r.align[o]
739
+ align: o.align[i]
707
740
  });
708
- for (let o of i) r.rows.push(ge(o, r.header.length).map((a, p) => ({
741
+ for (let i of s) o.rows.push(be(i, o.header.length).map((a, c) => ({
709
742
  text: a,
710
743
  tokens: this.lexer.inline(a),
711
744
  header: !1,
712
- align: r.align[p]
745
+ align: o.align[c]
713
746
  })));
714
- return r;
747
+ return o;
715
748
  }
716
749
  }
717
750
  lheading(e) {
@@ -720,7 +753,7 @@ ${m}`) ? ` ${H.replace(/^ {0,3}/, "")}` : m;
720
753
  let n = t[1].trim();
721
754
  return {
722
755
  type: "heading",
723
- raw: L(t[0], `
756
+ raw: C(t[0], `
724
757
  `),
725
758
  depth: t[2].charAt(0) === "=" ? 1 : 2,
726
759
  text: n,
@@ -751,6 +784,7 @@ ${m}`) ? ` ${H.replace(/^ {0,3}/, "")}` : m;
751
784
  };
752
785
  }
753
786
  escape(e) {
787
+ if (e.charCodeAt(0) !== 92) return;
754
788
  let t = this.rules.inline.escape.exec(e);
755
789
  if (t) return {
756
790
  type: "escape",
@@ -759,6 +793,7 @@ ${m}`) ? ` ${H.replace(/^ {0,3}/, "")}` : m;
759
793
  };
760
794
  }
761
795
  tag(e) {
796
+ if (e.charCodeAt(0) !== 60) return;
762
797
  let t = this.rules.inline.tag.exec(e);
763
798
  if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
764
799
  type: "html",
@@ -771,109 +806,112 @@ ${m}`) ? ` ${H.replace(/^ {0,3}/, "")}` : m;
771
806
  }
772
807
  link(e) {
773
808
  if (this.lexer.state.linkParenPossible === !1) return;
774
- let t = this.rules.inline.link.exec(e);
775
- if (t) {
776
- let n = t[0].charAt(0) === "!" ? 2 : 1;
777
- if (!this.options.pedantic && ve(e, t[1], n, this.rules)) return;
778
- let s = t[2].trim();
809
+ let t = e.charCodeAt(0);
810
+ if (t !== 91 && t !== 33) return;
811
+ let n = this.rules.inline.link.exec(e);
812
+ if (n) {
813
+ let r = n[0].charAt(0) === "!" ? 2 : 1;
814
+ if (!this.options.pedantic && Ze(e, n[1], r, this.rules)) return;
815
+ let s = n[2].trim();
779
816
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(s)) {
780
817
  if (!this.rules.other.endAngleBracket.test(s)) return;
781
- let a = L(s.slice(0, -1), "\\");
782
- if ((s.length - a.length) % 2 === 0) return;
818
+ let c = C(s.slice(0, -1), "\\");
819
+ if ((s.length - c.length) % 2 === 0) return;
783
820
  } else {
784
- let a = fe(t[2], "()");
785
- if (a === -2) return;
786
- if (a > -1) {
787
- let c = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + a;
788
- t[2] = t[2].substring(0, a), t[0] = t[0].substring(0, c).trim(), t[3] = "";
821
+ let c = Te(n[2], "()");
822
+ if (c === -2) return;
823
+ if (c > -1) {
824
+ let d = (n[0].indexOf("!") === 0 ? 5 : 4) + n[1].length + c;
825
+ n[2] = n[2].substring(0, c), n[0] = n[0].substring(0, d).trim(), n[3] = "";
789
826
  }
790
827
  }
791
- let i = L(t[0].slice(0, -1), "\\");
792
- if ((t[0].length - i.length) % 2 === 0) return;
793
- let r = t[2], o = "";
828
+ let o = C(n[0].slice(0, -1), "\\");
829
+ if ((n[0].length - o.length) % 2 === 0) return;
830
+ let i = n[2], a = "";
794
831
  if (this.options.pedantic) {
795
- let a = this.rules.other.pedanticHrefTitle.exec(r);
796
- a && (r = a[1], o = a[3]);
797
- } else o = t[3] ? t[3].slice(1, -1) : "";
798
- return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(s) ? r = r.slice(1) : r = r.slice(1, -1)), qe(t, {
799
- href: r && r.replace(this.rules.inline.anyPunctuation, "$1"),
800
- title: o && o.replace(this.rules.inline.anyPunctuation, "$1")
801
- }, t[0], this.lexer, this.rules);
832
+ let c = this.rules.other.pedanticHrefTitle.exec(i);
833
+ c && (i = c[1], a = c[3]);
834
+ } else a = n[3] ? n[3].slice(1, -1) : "";
835
+ return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(s) ? i = i.slice(1) : i = i.slice(1, -1)), He(n, {
836
+ href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
837
+ title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
838
+ }, n[0], this.lexer, this.rules);
802
839
  }
803
840
  }
804
841
  reflink(e, t) {
805
- let n;
806
- if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
807
- let s = n[0].charAt(0) === "!" ? 2 : 1;
808
- if (!this.options.pedantic && ve(e, n[1], s, this.rules)) return;
809
- let i = t[Q(n[2] || n[1])];
810
- if (!i) {
811
- let r = n[0].charAt(0);
842
+ let n = e.charCodeAt(0);
843
+ if (n !== 91 && n !== 33) return;
844
+ let r;
845
+ if ((r = this.rules.inline.reflink.exec(e)) || (r = this.rules.inline.nolink.exec(e))) {
846
+ let s = r[0].charAt(0) === "!" ? 2 : 1;
847
+ if (!this.options.pedantic && Ze(e, r[1], s, this.rules)) return;
848
+ let o = t[W(r[2] || r[1])];
849
+ if (!o) {
850
+ let i = r[0].charAt(0);
812
851
  return {
813
852
  type: "text",
814
- raw: r,
815
- text: r
853
+ raw: i,
854
+ text: i
816
855
  };
817
856
  }
818
- return qe(n, i, n[0], this.lexer, this.rules);
857
+ return He(r, o, r[0], this.lexer, this.rules);
819
858
  }
820
859
  }
821
860
  emStrong(e, t, n = "") {
822
- let s = this.rules.inline.emStrongLDelim.exec(e);
823
- if (!s || !s[1] && !s[2] && !s[3] && !s[4]) return;
824
- let i = s[0][0], r = n === i, o = t.length - e.length, a = o;
825
- for (; !this.options.pedantic && a > 0 && t[a - 1] === i;) a--;
826
- let p = [...t.slice(Math.max(0, a - 2), a)].at(-1) ?? "", c = p === "*" || p === "_" || !!this.rules.inline.punctuation.exec(p);
827
- a < o && (n = p);
828
- let u = a < o ? c : n === "*" || n === "_" || !!this.rules.inline.punctuation.exec(n);
829
- if (s[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
830
- let d = s[1] || s[3] || "";
831
- if (!d || !n || u) {
832
- let k = [...s[0]].length - 1, g, b, f = k, m = 0, S = o - a + k, R = !this.options.pedantic && !!p.trim() && (!!d || i === "*" && !c);
833
- if (i !== "*" && i !== "_") return;
834
- let A = i === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd, v = Be(this, t, i), U = t.length - e.length + k;
835
- if (v < U) return;
836
- t = t.slice(-1 * e.length + k);
837
- let ee = v - U;
838
- for (A.lastIndex = 0; (s = A.exec(t)) !== null && !(s.index > ee);) {
839
- if (g = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !g) continue;
840
- if (b = [...g].length, s[3] || s[4]) {
841
- f += b;
861
+ let r = this.rules.inline.emStrongLDelim.exec(e);
862
+ if (!r || !r[1] && !r[2] && !r[3] && !r[4]) return;
863
+ let s = r[0][0], o = n === s, i = t.length - e.length, a = i;
864
+ for (; !this.options.pedantic && a > 0 && t[a - 1] === s;) a--;
865
+ let c = [...t.slice(Math.max(0, a - 2), a)].at(-1) ?? "", u = c === "*" || c === "_" || !!this.rules.inline.punctuation.exec(c);
866
+ a < i && (n = c);
867
+ let d = a < i ? u : n === "*" || n === "_" || !!this.rules.inline.punctuation.exec(n);
868
+ if (r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
869
+ let h = r[1] || r[3] || "";
870
+ if (!h || !n || d) {
871
+ let p = [...r[0]].length - 1, k, m, b = p, f = 0, R = i - a + p, E = !this.options.pedantic && !!c.trim() && (!!h || s === "*" && !u);
872
+ if (s !== "*" && s !== "_") return;
873
+ let T = s === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd, U = oe(this, t, s), H = t.length - e.length + p;
874
+ if (U < H) return;
875
+ t = t.slice(-1 * e.length + p);
876
+ let K = U - H;
877
+ for (T.lastIndex = 0; (r = T.exec(t)) !== null && !(r.index > K);) {
878
+ if (k = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !k) continue;
879
+ if (m = [...k].length, r[3] || r[4]) {
880
+ b += m;
881
+ continue;
882
+ } else if ((r[5] || r[6] || E) && R % 3 && !((R + m) % 3)) {
883
+ if (o && (r[5] || r[6])) break;
884
+ f += m;
842
885
  continue;
843
- } else if (s[5] || s[6] || R) {
844
- if (r && (s[5] || s[6])) break;
845
- if (S % 3 && !((S + b) % 3)) {
846
- m += b;
847
- continue;
848
- }
849
886
  }
850
- if (f -= b, f > 0) continue;
851
- b = Math.min(b, b + f + m);
852
- let te = [...s[0]][0].length, M = e.slice(0, k + s.index + te + b);
853
- if (Math.min(k, b) % 2) {
854
- let Z = M.slice(1, -1);
887
+ if (b -= m, b > 0) continue;
888
+ m = Math.min(m, m + b + f);
889
+ let re = [...r[0]][0].length, B = e.slice(0, p + r.index + re + m);
890
+ if (Math.min(p, m) % 2) {
891
+ let se = B.slice(1, -1);
855
892
  return {
856
893
  type: "em",
857
- raw: M,
858
- text: Z,
859
- tokens: this.lexer.inlineTokens(Z)
894
+ raw: B,
895
+ text: se,
896
+ tokens: this.lexer.inlineTokens(se)
860
897
  };
861
898
  }
862
- let ne = M.slice(2, -2);
899
+ let X = B.slice(2, -2);
863
900
  return {
864
901
  type: "strong",
865
- raw: M,
866
- text: ne,
867
- tokens: this.lexer.inlineTokens(ne)
902
+ raw: B,
903
+ text: X,
904
+ tokens: this.lexer.inlineTokens(X)
868
905
  };
869
906
  }
870
907
  }
871
908
  }
872
909
  codespan(e) {
910
+ if (e.charCodeAt(0) !== 96) return;
873
911
  let t = this.rules.inline.code.exec(e);
874
912
  if (t) {
875
- let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(n), i = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
876
- return s && i && (n = n.substring(1, n.length - 1)), {
913
+ let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), r = this.rules.other.nonSpaceChar.test(n), s = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
914
+ return r && s && (n = n.substring(1, n.length - 1)), {
877
915
  type: "codespan",
878
916
  raw: t[0],
879
917
  text: n
@@ -881,47 +919,51 @@ ${m}`) ? ` ${H.replace(/^ {0,3}/, "")}` : m;
881
919
  }
882
920
  }
883
921
  br(e) {
884
- let t = this.rules.inline.br.exec(e);
885
- if (t) return {
922
+ let t = e.charCodeAt(0);
923
+ if (t !== 32 && t !== 92 && t !== 10) return;
924
+ let n = this.rules.inline.br.exec(e);
925
+ if (n) return {
886
926
  type: "br",
887
- raw: t[0]
927
+ raw: n[0]
888
928
  };
889
929
  }
890
930
  del(e, t, n = "") {
891
- let s = this.rules.inline.delLDelim.exec(e);
892
- if (!s) return;
893
- if (!(s[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
894
- let r = [...s[0]].length - 1, o, a, p = r, c = this.rules.inline.delRDelim, u = De(this, t), d = t.length - e.length + r;
895
- if (u < d) return;
896
- t = t.slice(-1 * e.length + r);
897
- let k = u - d;
898
- for (c.lastIndex = 0; (s = c.exec(t)) !== null && !(s.index > k);) {
899
- if (o = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !o || (a = [...o].length, a !== r)) continue;
900
- if (s[3] || s[4]) {
901
- p += a;
931
+ if (e.charCodeAt(0) !== 126) return;
932
+ let r = this.rules.inline.delLDelim.exec(e);
933
+ if (!r) return;
934
+ if (!(r[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
935
+ let o = [...r[0]].length - 1, i, a, c = o, u = this.rules.inline.delRDelim, d = ae(this, t), h = t.length - e.length + o;
936
+ if (d < h) return;
937
+ t = t.slice(-1 * e.length + o);
938
+ let p = d - h;
939
+ for (u.lastIndex = 0; (r = u.exec(t)) !== null && !(r.index > p);) {
940
+ if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i || (a = [...i].length, a !== o)) continue;
941
+ if (r[3] || r[4]) {
942
+ c += a;
902
943
  continue;
903
944
  }
904
- if (p -= a, p > 0) continue;
905
- a = Math.min(a, a + p);
906
- let g = [...s[0]][0].length, b = e.slice(0, r + s.index + g + a), f = b.slice(r, -r);
945
+ if (c -= a, c > 0) continue;
946
+ a = Math.min(a, a + c);
947
+ let k = [...r[0]][0].length, m = e.slice(0, o + r.index + k + a), b = m.slice(o, -o);
907
948
  return {
908
949
  type: "del",
909
- raw: b,
910
- text: f,
911
- tokens: this.lexer.inlineTokens(f)
950
+ raw: m,
951
+ text: b,
952
+ tokens: this.lexer.inlineTokens(b)
912
953
  };
913
954
  }
914
955
  }
915
956
  }
916
957
  autolink(e) {
958
+ if (e.charCodeAt(0) !== 60) return;
917
959
  let t = this.rules.inline.autolink.exec(e);
918
960
  if (t) {
919
- let n, s;
920
- return t[2] === "@" ? (n = t[1], s = "mailto:" + n) : (n = t[1], s = n), {
961
+ let n, r;
962
+ return t[2] === "@" ? (n = t[1], r = "mailto:" + n) : (n = t[1], r = n), {
921
963
  type: "link",
922
964
  raw: t[0],
923
965
  text: n,
924
- href: s,
966
+ href: r,
925
967
  autolink: !0,
926
968
  tokens: [{
927
969
  type: "text",
@@ -934,20 +976,20 @@ ${m}`) ? ` ${H.replace(/^ {0,3}/, "")}` : m;
934
976
  url(e) {
935
977
  let t;
936
978
  if (t = this.rules.inline.url.exec(e)) {
937
- let n, s;
938
- if (t[2] === "@") n = t[0], s = "mailto:" + n;
979
+ let n, r;
980
+ if (t[2] === "@") n = t[0], r = "mailto:" + n;
939
981
  else {
940
- let i;
982
+ let s;
941
983
  do
942
- i = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
943
- while (i !== t[0]);
944
- n = t[0], t[1] === "www." ? s = "http://" + t[0] : s = t[0];
984
+ s = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
985
+ while (s !== t[0]);
986
+ n = t[0], t[1] === "www." ? r = "http://" + t[0] : r = t[0];
945
987
  }
946
988
  return {
947
989
  type: "link",
948
990
  raw: t[0],
949
991
  text: n,
950
- href: s,
992
+ href: r,
951
993
  autolink: !0,
952
994
  tokens: [{
953
995
  type: "text",
@@ -964,20 +1006,20 @@ ${m}`) ? ` ${H.replace(/^ {0,3}/, "")}` : m;
964
1006
  return {
965
1007
  type: "text",
966
1008
  raw: t[0],
967
- text: n ? t[0] : Ee(t[0]),
1009
+ text: n ? t[0] : De(t[0]),
968
1010
  escaped: n
969
1011
  };
970
1012
  }
971
1013
  }
972
1014
  };
973
- var O = class l {
1015
+ var w = class l {
974
1016
  tokens;
975
1017
  options;
976
1018
  state;
977
1019
  inlineQueue;
978
1020
  tokenizer;
979
1021
  constructor(e) {
980
- this.tokens = [], this.tokens.links = Object.create(null), this.options = e || y, this.options.tokenizer = this.options.tokenizer || new _(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1022
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || S, this.options.tokenizer = this.options.tokenizer || new _(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
981
1023
  inLink: !1,
982
1024
  inRawBlock: !1,
983
1025
  linkEmitted: !1,
@@ -985,16 +1027,16 @@ var O = class l {
985
1027
  top: !0
986
1028
  };
987
1029
  let t = {
988
- other: T,
989
- block: V.normal,
990
- inline: N.normal
1030
+ other: O,
1031
+ block: ee.normal,
1032
+ inline: F.normal
991
1033
  };
992
- this.options.pedantic ? (t.block = V.pedantic, t.inline = N.pedantic) : this.options.gfm && (t.block = V.gfm, this.options.breaks ? t.inline = N.breaks : t.inline = N.gfm), this.tokenizer.rules = t;
1034
+ this.options.pedantic ? (t.block = ee.pedantic, t.inline = F.pedantic) : this.options.gfm && (t.block = ee.gfm, this.options.breaks ? t.inline = F.breaks : t.inline = F.gfm), this.tokenizer.rules = t;
993
1035
  }
994
1036
  static get rules() {
995
1037
  return {
996
- block: V,
997
- inline: N
1038
+ block: ee,
1039
+ inline: F
998
1040
  };
999
1041
  }
1000
1042
  static lex(e, t) {
@@ -1004,7 +1046,7 @@ var O = class l {
1004
1046
  return new l(t).inlineTokens(e);
1005
1047
  }
1006
1048
  lex(e) {
1007
- e = e.replace(T.carriageReturn, `
1049
+ e = e.replace(O.carriageReturn, `
1008
1050
  `), this.blockTokens(e, this.tokens);
1009
1051
  for (let t = 0; t < this.inlineQueue.length; t++) {
1010
1052
  let n = this.inlineQueue[t];
@@ -1014,100 +1056,100 @@ var O = class l {
1014
1056
  }
1015
1057
  blockTokens(e, t = [], n = !1) {
1016
1058
  this.tokenizer.lexer = this;
1017
- let s = this.state.lastToken;
1018
- this.options.pedantic && (e = e.replace(T.tabCharGlobal, " ").replace(T.spaceLine, ""));
1019
- let i = 1 / 0;
1059
+ let r = this.state.lastToken;
1060
+ this.options.pedantic && (e = e.replace(O.tabCharGlobal, " ").replace(O.spaceLine, ""));
1061
+ let s = 1 / 0, o, i = this.options.gfm && !this.options.pedantic && this.tokenizer.paragraph === _.prototype.paragraph;
1020
1062
  for (; e;) {
1021
- if (e.length < i) i = e.length;
1063
+ if (e.length < s) s = e.length;
1022
1064
  else {
1023
1065
  this.infiniteLoopError(e.charCodeAt(0));
1024
1066
  break;
1025
1067
  }
1026
1068
  this.state.lastToken = t.at(-1);
1027
- let r;
1028
- if (this.options.extensions?.block?.some((a) => (r = a.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
1029
- if (r = this.tokenizer.space(e)) {
1030
- e = e.substring(r.raw.length);
1031
- let a = t.at(-1);
1032
- r.raw.length === 1 && a !== void 0 ? a.raw += `
1033
- ` : t.push(r);
1069
+ let a;
1070
+ if (this.options.extensions?.block?.some((u) => (a = u.call({ lexer: this }, e, t)) ? (e = e.substring(a.raw.length), t.push(a), !0) : !1)) continue;
1071
+ if (a = this.tokenizer.space(e)) {
1072
+ e = e.substring(a.raw.length);
1073
+ let u = t.at(-1);
1074
+ a.raw.length === 1 && u !== void 0 ? u.raw += `
1075
+ ` : t.push(a);
1034
1076
  continue;
1035
1077
  }
1036
- if (r = this.tokenizer.code(e)) {
1037
- e = e.substring(r.raw.length);
1038
- let a = t.at(-1);
1039
- a?.type === "paragraph" || a?.type === "text" ? (a.raw += (a.raw.endsWith(`
1078
+ if (a = this.tokenizer.code(e)) {
1079
+ e = e.substring(a.raw.length);
1080
+ let u = t.at(-1);
1081
+ u?.type === "paragraph" || u?.type === "text" ? (u.raw += (u.raw.endsWith(`
1040
1082
  `) ? "" : `
1041
- `) + r.raw, a.text += `
1042
- ` + r.text, this.inlineQueue.at(-1).src = a.text) : t.push(r);
1083
+ `) + a.raw, u.text += `
1084
+ ` + a.text, this.inlineQueue.at(-1).src = u.text) : t.push(a);
1043
1085
  continue;
1044
1086
  }
1045
- if (r = this.tokenizer.fences(e)) {
1046
- e = e.substring(r.raw.length), t.push(r);
1087
+ if (a = this.tokenizer.fences(e)) {
1088
+ e = e.substring(a.raw.length), t.push(a);
1047
1089
  continue;
1048
1090
  }
1049
- if (r = this.tokenizer.heading(e)) {
1050
- e = e.substring(r.raw.length), t.push(r);
1091
+ if (a = this.tokenizer.heading(e)) {
1092
+ e = e.substring(a.raw.length), t.push(a);
1051
1093
  continue;
1052
1094
  }
1053
- if (r = this.tokenizer.hr(e)) {
1054
- e = e.substring(r.raw.length), t.push(r);
1095
+ if (a = this.tokenizer.hr(e)) {
1096
+ e = e.substring(a.raw.length), t.push(a);
1055
1097
  continue;
1056
1098
  }
1057
- if (r = this.tokenizer.blockquote(e)) {
1058
- e = e.substring(r.raw.length), t.push(r);
1099
+ if (a = this.tokenizer.blockquote(e)) {
1100
+ e = e.substring(a.raw.length), t.push(a);
1059
1101
  continue;
1060
1102
  }
1061
- if (r = this.tokenizer.list(e)) {
1062
- e = e.substring(r.raw.length), t.push(r);
1103
+ if (a = this.tokenizer.list(e)) {
1104
+ e = e.substring(a.raw.length), t.push(a);
1063
1105
  continue;
1064
1106
  }
1065
- if (r = this.tokenizer.html(e)) {
1066
- e = e.substring(r.raw.length), t.push(r);
1107
+ if (a = this.tokenizer.html(e)) {
1108
+ e = e.substring(a.raw.length), t.push(a);
1067
1109
  continue;
1068
1110
  }
1069
- if (r = this.tokenizer.def(e)) {
1070
- e = e.substring(r.raw.length);
1071
- let a = t.at(-1);
1072
- a?.type === "paragraph" || a?.type === "text" ? (a.raw += (a.raw.endsWith(`
1111
+ if (a = this.tokenizer.def(e)) {
1112
+ e = e.substring(a.raw.length);
1113
+ let u = t.at(-1);
1114
+ u?.type === "paragraph" || u?.type === "text" ? (u.raw += (u.raw.endsWith(`
1073
1115
  `) ? "" : `
1074
- `) + r.raw, a.text += `
1075
- ` + r.raw, this.inlineQueue.at(-1).src = a.text) : (this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
1076
- href: r.href,
1077
- title: r.title
1078
- }), t.push(r));
1116
+ `) + a.raw, u.text += `
1117
+ ` + a.raw, this.inlineQueue.at(-1).src = u.text) : (this.tokens.links[a.tag] || (this.tokens.links[a.tag] = {
1118
+ href: a.href,
1119
+ title: a.title
1120
+ }), t.push(a));
1079
1121
  continue;
1080
1122
  }
1081
- if (r = this.tokenizer.table(e)) {
1082
- e = e.substring(r.raw.length), t.push(r);
1123
+ if (a = this.tokenizer.table(e)) {
1124
+ e = e.substring(a.raw.length), t.push(a);
1083
1125
  continue;
1084
1126
  }
1085
- if (r = this.tokenizer.lheading(e)) {
1086
- e = e.substring(r.raw.length), t.push(r);
1127
+ if (a = this.tokenizer.lheading(e)) {
1128
+ e = e.substring(a.raw.length), t.push(a);
1087
1129
  continue;
1088
1130
  }
1089
- let o = e;
1131
+ let c = e;
1090
1132
  if (this.options.extensions?.startBlock) {
1091
- let a = 1 / 0, p = e.slice(1), c;
1092
- this.options.extensions.startBlock.forEach((u) => {
1093
- c = u.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (a = Math.min(a, c));
1094
- }), a < 1 / 0 && a >= 0 && (o = e.substring(0, a + 1));
1133
+ let u = 1 / 0, d = e.slice(1), h;
1134
+ this.options.extensions.startBlock.forEach((p) => {
1135
+ h = p.call({ lexer: this }, d), typeof h == "number" && h >= 0 && (u = Math.min(u, h));
1136
+ }), u < 1 / 0 && u >= 0 && (c = e.substring(0, u + 1));
1095
1137
  }
1096
- if (this.state.top && (r = this.tokenizer.paragraph(o))) {
1097
- let a = t.at(-1);
1098
- n && a?.type === "paragraph" ? (a.raw += (a.raw.endsWith(`
1138
+ if (this.state.top && (a = this.tokenizer.paragraph(c))) {
1139
+ let u = t.at(-1);
1140
+ (n || u === o && i) && u?.type === "paragraph" ? (u.raw += (u.raw.endsWith(`
1099
1141
  `) ? "" : `
1100
- `) + r.raw, a.text += `
1101
- ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = a.text) : t.push(r), n = o.length !== e.length, e = e.substring(r.raw.length);
1142
+ `) + a.raw, u.text += `
1143
+ ` + a.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = u.text, o = u) : (t.push(a), o = a), n = c.length !== e.length, e = e.substring(a.raw.length);
1102
1144
  continue;
1103
1145
  }
1104
- if (r = this.tokenizer.text(e)) {
1105
- e = e.substring(r.raw.length);
1106
- let a = t.at(-1);
1107
- a?.type === "text" ? (a.raw += (a.raw.endsWith(`
1146
+ if (a = this.tokenizer.text(e)) {
1147
+ e = e.substring(a.raw.length);
1148
+ let u = t.at(-1);
1149
+ u?.type === "text" ? (u.raw += (u.raw.endsWith(`
1108
1150
  `) ? "" : `
1109
- `) + r.raw, a.text += `
1110
- ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = a.text) : t.push(r);
1151
+ `) + a.raw, u.text += `
1152
+ ` + a.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = u.text) : t.push(a);
1111
1153
  continue;
1112
1154
  }
1113
1155
  if (e) {
@@ -1115,7 +1157,7 @@ var O = class l {
1115
1157
  break;
1116
1158
  }
1117
1159
  }
1118
- return this.state.top = !0, this.state.lastToken = s, t;
1160
+ return this.state.top = !0, this.state.lastToken = r, t;
1119
1161
  }
1120
1162
  inline(e, t = []) {
1121
1163
  return this.inlineQueue.push({
@@ -1128,94 +1170,125 @@ var O = class l {
1128
1170
  let t = this.tokenizer.rules.inline.link;
1129
1171
  for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
1130
1172
  for (let n of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
1131
- let s = n[0], i = s.lastIndexOf("[");
1132
- if (!(s.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, Q(s.slice(i + 1, -1)))) && !(i > 1 && this.linkInText(s.slice(1, i - 1)))) return !0;
1173
+ let r = n[0], s = r.lastIndexOf("[");
1174
+ if (!(r.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, W(r.slice(s + 1, -1)))) && !(s > 1 && this.linkInText(r.slice(1, s - 1)))) return !0;
1133
1175
  }
1134
1176
  return !1;
1135
1177
  }
1136
1178
  inlineTokens(e, t = []) {
1137
1179
  this.tokenizer.lexer = this;
1138
1180
  let n = this.state.linkParenPossible;
1139
- this.state.linkParenPossible = n && e.includes(")");
1181
+ this.state.linkParenPossible = e.includes(")");
1140
1182
  try {
1141
- return this.#e(e, t);
1183
+ return this.#t(e, t);
1142
1184
  } finally {
1143
1185
  this.state.linkParenPossible = n;
1144
1186
  }
1145
1187
  }
1146
- #e(e, t) {
1147
- let n = e.includes("*") || e.includes("_") || e.includes("~") || this.options.hooks?.emStrongMask || this.tokenizer.emStrong !== _.prototype.emStrong || this.tokenizer.del !== _.prototype.del ? this.#r(e) : e;
1148
- ze(this.tokenizer, n);
1188
+ #t(e, t) {
1189
+ let n = e.includes("*") || e.includes("_") || e.includes("~"), r = n || this.options.hooks?.emStrongMask || this.tokenizer.emStrong !== _.prototype.emStrong || this.tokenizer.del !== _.prototype.del ? this.#r(e) : e;
1190
+ if (!n) return this.#e(e, r, t);
1191
+ qe(this.tokenizer, r);
1149
1192
  try {
1150
- return this.#t(e, n, t);
1193
+ return this.#e(e, r, t);
1151
1194
  } finally {
1152
- Me(this.tokenizer);
1195
+ ve(this.tokenizer);
1153
1196
  }
1154
1197
  }
1155
- #t(e, t, n) {
1156
- let s = !1, i = "", r = 1 / 0;
1198
+ #e(e, t, n) {
1199
+ let r = !1, s = "", o = 1 / 0;
1157
1200
  for (; e;) {
1158
- if (e.length < r) r = e.length;
1201
+ if (e.length < o) o = e.length;
1159
1202
  else {
1160
1203
  this.infiniteLoopError(e.charCodeAt(0));
1161
1204
  break;
1162
1205
  }
1163
- s || (i = ""), s = !1;
1164
- let o;
1165
- if (this.options.extensions?.inline?.some((p) => (o = p.call({ lexer: this }, e, n)) ? (e = e.substring(o.raw.length), n.push(o), !0) : !1)) continue;
1166
- if (o = this.tokenizer.escape(e)) {
1167
- e = e.substring(o.raw.length), n.push(o);
1206
+ r || (s = ""), r = !1;
1207
+ let i;
1208
+ if (this.options.extensions?.inline?.some((u) => (i = u.call({ lexer: this }, e, n)) ? (e = e.substring(i.raw.length), n.push(i), !0) : !1)) continue;
1209
+ if (i = this.tokenizer.escape(e)) {
1210
+ e = e.substring(i.raw.length), n.push(i);
1168
1211
  continue;
1169
1212
  }
1170
- if (o = this.tokenizer.tag(e)) {
1171
- e = e.substring(o.raw.length), n.push(o);
1213
+ if (i = this.tokenizer.tag(e)) {
1214
+ e = e.substring(i.raw.length), n.push(i);
1172
1215
  continue;
1173
1216
  }
1174
- if (o = this.tokenizer.link(e)) {
1175
- e = e.substring(o.raw.length), n.push(o);
1217
+ if (i = this.tokenizer.link(e)) {
1218
+ e = e.substring(i.raw.length), n.push(i);
1176
1219
  continue;
1177
1220
  }
1178
- if (o = this.tokenizer.reflink(e, this.tokens.links)) {
1179
- e = e.substring(o.raw.length);
1180
- let p = n.at(-1);
1181
- o.type === "text" && p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : n.push(o);
1221
+ if (i = this.tokenizer.reflink(e, this.tokens.links)) {
1222
+ e = e.substring(i.raw.length);
1223
+ let u = n.at(-1);
1224
+ i.type === "text" && u?.type === "text" ? (u.raw += i.raw, u.text += i.text) : n.push(i);
1182
1225
  continue;
1183
1226
  }
1184
- if (o = this.tokenizer.emStrong(e, t, i)) {
1185
- e = e.substring(o.raw.length), n.push(o);
1227
+ let a = e[0];
1228
+ if (a === "*" || a === "_") {
1229
+ let u = t.length - e.length;
1230
+ if (oe(this.tokenizer, t, a) <= u) {
1231
+ let h = 1;
1232
+ for (; h < e.length && e.charCodeAt(h) === a.charCodeAt(0);) h++;
1233
+ let p = e.substring(0, h), k = n.at(-1);
1234
+ k?.type === "text" && !k.escaped ? (k.raw += p, k.text += p) : n.push({
1235
+ type: "text",
1236
+ raw: p,
1237
+ text: p,
1238
+ escaped: !1
1239
+ }), e = e.substring(h), s = a, r = !0;
1240
+ continue;
1241
+ }
1242
+ } else if (a === "~") {
1243
+ let u = t.length - e.length;
1244
+ if (ae(this.tokenizer, t) <= u) {
1245
+ let h = 1;
1246
+ for (; h < e.length && e.charCodeAt(h) === 126;) h++;
1247
+ let p = e.substring(0, h), k = n.at(-1);
1248
+ k?.type === "text" && !k.escaped ? (k.raw += p, k.text += p) : n.push({
1249
+ type: "text",
1250
+ raw: p,
1251
+ text: p,
1252
+ escaped: !1
1253
+ }), e = e.substring(h), s = a, r = !0;
1254
+ continue;
1255
+ }
1256
+ }
1257
+ if (i = this.tokenizer.emStrong(e, t, s)) {
1258
+ e = e.substring(i.raw.length), n.push(i);
1186
1259
  continue;
1187
1260
  }
1188
- if (o = this.tokenizer.codespan(e)) {
1189
- e = e.substring(o.raw.length), n.push(o);
1261
+ if (i = this.tokenizer.codespan(e)) {
1262
+ e = e.substring(i.raw.length), n.push(i);
1190
1263
  continue;
1191
1264
  }
1192
- if (o = this.tokenizer.br(e)) {
1193
- e = e.substring(o.raw.length), n.push(o);
1265
+ if (i = this.tokenizer.br(e)) {
1266
+ e = e.substring(i.raw.length), n.push(i);
1194
1267
  continue;
1195
1268
  }
1196
- if (o = this.tokenizer.del(e, t, i)) {
1197
- e = e.substring(o.raw.length), n.push(o);
1269
+ if (i = this.tokenizer.del(e, t, s)) {
1270
+ e = e.substring(i.raw.length), n.push(i);
1198
1271
  continue;
1199
1272
  }
1200
- if (o = this.tokenizer.autolink(e)) {
1201
- e = e.substring(o.raw.length), n.push(o);
1273
+ if (i = this.tokenizer.autolink(e)) {
1274
+ e = e.substring(i.raw.length), n.push(i);
1202
1275
  continue;
1203
1276
  }
1204
- if (!this.state.inLink && (o = this.tokenizer.url(e))) {
1205
- e = e.substring(o.raw.length), n.push(o);
1277
+ if (!this.state.inLink && (i = this.tokenizer.url(e))) {
1278
+ e = e.substring(i.raw.length), n.push(i);
1206
1279
  continue;
1207
1280
  }
1208
- let a = e;
1281
+ let c = e;
1209
1282
  if (this.options.extensions?.startInline) {
1210
- let p = 1 / 0, c = e.slice(1), u;
1211
- this.options.extensions.startInline.forEach((d) => {
1212
- u = d.call({ lexer: this }, c), typeof u == "number" && u >= 0 && (p = Math.min(p, u));
1213
- }), p < 1 / 0 && p >= 0 && (a = e.substring(0, p + 1));
1283
+ let u = 1 / 0, d = e.slice(1), h;
1284
+ this.options.extensions.startInline.forEach((p) => {
1285
+ h = p.call({ lexer: this }, d), typeof h == "number" && h >= 0 && (u = Math.min(u, h));
1286
+ }), u < 1 / 0 && u >= 0 && (c = e.substring(0, u + 1));
1214
1287
  }
1215
- if (o = this.tokenizer.inlineText(a)) {
1216
- e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (i = o.raw.slice(-1)), s = !0;
1217
- let p = n.at(-1);
1218
- p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : n.push(o);
1288
+ if (i = this.tokenizer.inlineText(c)) {
1289
+ e = e.substring(i.raw.length), i.raw.slice(-1) !== "_" && (s = i.raw.slice(-1)), r = !0;
1290
+ let u = n.at(-1);
1291
+ u?.type === "text" ? (u.raw += i.raw, u.text += i.text) : n.push(i);
1219
1292
  continue;
1220
1293
  }
1221
1294
  if (e) {
@@ -1226,36 +1299,36 @@ var O = class l {
1226
1299
  return n;
1227
1300
  }
1228
1301
  #n(e) {
1229
- let { blockSkip: t, tag: n, autolink: s } = this.tokenizer.rules.inline, i = "", r = 0, o;
1230
- for (t.lastIndex = 0; o = t.exec(e);) {
1231
- let a = o.index + (o[2] ? o[2].length : 0), p = o.index + o[0].length;
1302
+ let { blockSkip: t, tag: n, autolink: r } = this.tokenizer.rules.inline, s = "", o = 0, i;
1303
+ for (t.lastIndex = 0; i = t.exec(e);) {
1304
+ let a = i.index + (i[2] ? i[2].length : 0), c = i.index + i[0].length;
1232
1305
  if (e.charAt(a) === "<") {
1233
- let c = e.slice(a), u = n.exec(c) || s.exec(c);
1234
- if (!u) {
1306
+ let u = e.slice(a), d = n.exec(u) || r.exec(u);
1307
+ if (!d) {
1235
1308
  t.lastIndex = a + 1;
1236
1309
  continue;
1237
1310
  }
1238
- p = a + u[0].length, t.lastIndex = p;
1311
+ c = a + d[0].length, t.lastIndex = c;
1239
1312
  }
1240
- i += e.slice(r, a) + "[" + "a".repeat(p - a - 2) + "]", r = p;
1313
+ s += e.slice(o, a) + "[" + "a".repeat(c - a - 2) + "]", o = c;
1241
1314
  }
1242
- return i + e.slice(r);
1315
+ return s + e.slice(o);
1243
1316
  }
1244
1317
  #r(e) {
1245
1318
  let t = e;
1246
1319
  if (this.tokens.links && e.includes("[")) {
1247
- let n = this.tokenizer.rules.inline.reflinkSearch, s = (i) => {
1248
- let r = i.lastIndexOf("[");
1249
- if (!Object.hasOwn(this.tokens.links, Q(i.slice(r + 1, -1)))) return i;
1250
- if (r > 1 && i.charAt(0) !== "!") {
1251
- let o = i.slice(1, r - 1);
1252
- if (this.linkInText(o)) return "[" + o.replace(n, s) + "][" + "a".repeat(i.length - r - 2) + "]";
1320
+ let n = this.tokenizer.rules.inline.reflinkSearch, r = (s) => {
1321
+ let o = s.lastIndexOf("[");
1322
+ if (!Object.hasOwn(this.tokens.links, W(s.slice(o + 1, -1)))) return s;
1323
+ if (o > 1 && s.charAt(0) !== "!") {
1324
+ let i = s.slice(1, o - 1);
1325
+ if (this.linkInText(i)) return "[" + i.replace(n, r) + "][" + "a".repeat(s.length - o - 2) + "]";
1253
1326
  }
1254
- return "[" + "a".repeat(i.length - 2) + "]";
1327
+ return "[" + "a".repeat(s.length - 2) + "]";
1255
1328
  };
1256
- t = t.replace(n, s);
1329
+ t = t.replace(n, r);
1257
1330
  }
1258
- return t = t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode, (n, s, i) => i ? "+".repeat(n.length) : s ? s + n.slice(s.length, -s.length).replace(/`/g, "+") + s : n), t = this.#n(t), t = this.options.hooks?.emStrongMask?.call({ lexer: this }, t) ?? t, t;
1331
+ return t = t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode, (n, r, s) => s ? "+".repeat(n.length) : r ? r + n.slice(r.length, -r.length).replace(/`/g, "+") + r : n), t = this.#n(t), t = this.options.hooks?.emStrongMask?.call({ lexer: this }, t) ?? t, t;
1259
1332
  }
1260
1333
  infiniteLoopError(e) {
1261
1334
  let t = "Infinite loop on byte: " + e;
@@ -1263,20 +1336,20 @@ var O = class l {
1263
1336
  else throw new Error(t);
1264
1337
  }
1265
1338
  };
1266
- var C = class {
1339
+ var I = class {
1267
1340
  options;
1268
1341
  parser;
1269
1342
  constructor(e) {
1270
- this.options = e || y;
1343
+ this.options = e || S;
1271
1344
  }
1272
1345
  space(e) {
1273
1346
  return "";
1274
1347
  }
1275
1348
  code({ text: e, lang: t, escaped: n }) {
1276
- let s = (t || "").match(T.notSpaceStart)?.[0], i = e ? e.replace(T.endingNewline, "") + `
1349
+ let r = (t || "").match(O.notSpaceStart)?.[0], s = e ? e.replace(O.endingNewline, "") + `
1277
1350
  ` : "";
1278
- return s ? "<pre><code class=\"language-" + P(s) + "\">" + (n ? i : P(i, !0)) + `</code></pre>
1279
- ` : "<pre><code>" + (n ? i : P(i, !0)) + `</code></pre>
1351
+ return r ? "<pre><code class=\"language-" + y(r) + "\">" + (n ? s : y(s, !0)) + `</code></pre>
1352
+ ` : "<pre><code>" + (n ? s : y(s, !0)) + `</code></pre>
1280
1353
  `;
1281
1354
  }
1282
1355
  blockquote({ tokens: e }) {
@@ -1299,14 +1372,14 @@ ${this.parser.parse(e)}</blockquote>
1299
1372
  `;
1300
1373
  }
1301
1374
  list(e) {
1302
- let t = e.ordered, n = e.start, s = "";
1303
- for (let o = 0; o < e.items.length; o++) {
1304
- let a = e.items[o];
1305
- s += this.listitem(a);
1375
+ let t = e.ordered, n = e.start, r = "";
1376
+ for (let i = 0; i < e.items.length; i++) {
1377
+ let a = e.items[i];
1378
+ r += this.listitem(a);
1306
1379
  }
1307
- let i = t ? "ol" : "ul", r = t && n !== 1 ? " start=\"" + n + "\"" : "";
1308
- return "<" + i + r + `>
1309
- ` + s + "</" + i + `>
1380
+ let s = t ? "ol" : "ul", o = t && n !== 1 ? " start=\"" + n + "\"" : "";
1381
+ return "<" + s + o + `>
1382
+ ` + r + "</" + s + `>
1310
1383
  `;
1311
1384
  }
1312
1385
  listitem(e) {
@@ -1322,19 +1395,19 @@ ${this.parser.parse(e)}</blockquote>
1322
1395
  }
1323
1396
  table(e) {
1324
1397
  let t = "", n = "";
1325
- for (let i = 0; i < e.header.length; i++) n += this.tablecell(e.header[i]);
1398
+ for (let s = 0; s < e.header.length; s++) n += this.tablecell(e.header[s]);
1326
1399
  t += this.tablerow({ text: n });
1327
- let s = "";
1328
- for (let i = 0; i < e.rows.length; i++) {
1329
- let r = e.rows[i];
1400
+ let r = "";
1401
+ for (let s = 0; s < e.rows.length; s++) {
1402
+ let o = e.rows[s];
1330
1403
  n = "";
1331
- for (let o = 0; o < r.length; o++) n += this.tablecell(r[o]);
1332
- s += this.tablerow({ text: n });
1404
+ for (let i = 0; i < o.length; i++) n += this.tablecell(o[i]);
1405
+ r += this.tablerow({ text: n });
1333
1406
  }
1334
- return s && (s = `<tbody>${s}</tbody>`), `<table>
1407
+ return r && (r = `<tbody>${r}</tbody>`), `<table>
1335
1408
  <thead>
1336
1409
  ` + t + `</thead>
1337
- ` + s + `</table>
1410
+ ` + r + `</table>
1338
1411
  `;
1339
1412
  }
1340
1413
  tablerow({ text: e }) {
@@ -1354,7 +1427,7 @@ ${e}</tr>
1354
1427
  return `<em>${this.parser.parseInline(e)}</em>`;
1355
1428
  }
1356
1429
  codespan({ text: e }) {
1357
- return `<code>${P(e, !0)}</code>`;
1430
+ return `<code>${y(e, !0)}</code>`;
1358
1431
  }
1359
1432
  br(e) {
1360
1433
  return "<br>";
@@ -1362,26 +1435,26 @@ ${e}</tr>
1362
1435
  del({ tokens: e }) {
1363
1436
  return `<del>${this.parser.parseInline(e)}</del>`;
1364
1437
  }
1365
- link({ href: e, title: t, text: n, tokens: s, autolink: i }) {
1366
- let r = i ? P(n, !0) : this.parser.parseInline(s), o = de(e);
1367
- if (o === null) return r;
1368
- e = P(o, i);
1438
+ link({ href: e, title: t, text: n, tokens: r, autolink: s }) {
1439
+ let o = s ? y(n, !0) : this.parser.parseInline(r), i = xe(e);
1440
+ if (i === null) return o;
1441
+ e = y(i, s);
1369
1442
  let a = "<a href=\"" + e + "\"";
1370
- return t && (a += " title=\"" + P(t) + "\""), a += ">" + r + "</a>", a;
1443
+ return t && (a += " title=\"" + y(t) + "\""), a += ">" + o + "</a>", a;
1371
1444
  }
1372
- image({ href: e, title: t, text: n, tokens: s }) {
1373
- s && (n = this.parser.parseInline(s, this.parser.textRenderer));
1374
- let i = de(e);
1375
- if (i === null) return P(n);
1376
- e = i;
1377
- let r = `<img src="${P(e)}" alt="${P(n)}"`;
1378
- return t && (r += ` title="${P(t)}"`), r += ">", r;
1445
+ image({ href: e, title: t, text: n, tokens: r }) {
1446
+ r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1447
+ let s = xe(e);
1448
+ if (s === null) return y(n);
1449
+ e = s;
1450
+ let o = `<img src="${y(e)}" alt="${y(n)}"`;
1451
+ return t && (o += ` title="${y(t)}"`), o += ">", o;
1379
1452
  }
1380
1453
  text(e) {
1381
- return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : P(e.text);
1454
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : y(e.text);
1382
1455
  }
1383
1456
  };
1384
- var E = class {
1457
+ var z = class {
1385
1458
  parser;
1386
1459
  strong({ text: e, tokens: t }) {
1387
1460
  return t ? this.parser.parseInline(t, this) : e;
@@ -1415,12 +1488,12 @@ var E = class {
1415
1488
  return e;
1416
1489
  }
1417
1490
  };
1418
- var w = class l {
1491
+ var P = class l {
1419
1492
  options;
1420
1493
  renderer;
1421
1494
  textRenderer;
1422
1495
  constructor(e) {
1423
- this.options = e || y, this.options.renderer = this.options.renderer || new C(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new E(), this.textRenderer.parser = this;
1496
+ this.options = e || S, this.options.renderer = this.options.renderer || new I(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new z(), this.textRenderer.parser = this;
1424
1497
  }
1425
1498
  static parse(e, t) {
1426
1499
  return new l(t).parse(e);
@@ -1432,10 +1505,10 @@ var w = class l {
1432
1505
  this.renderer.parser = this;
1433
1506
  let t = "";
1434
1507
  for (let n = 0; n < e.length; n++) {
1435
- let s = e[n];
1436
- if (this.options.extensions?.renderers?.[s.type]) {
1437
- let r = s, o = this.options.extensions.renderers[r.type].call({ parser: this }, r);
1438
- if (o !== !1 || ![
1508
+ let r = e[n];
1509
+ if (this.options.extensions?.renderers?.[r.type]) {
1510
+ let o = r, i = this.options.extensions.renderers[o.type].call({ parser: this }, o);
1511
+ if (i !== !1 || ![
1439
1512
  "space",
1440
1513
  "hr",
1441
1514
  "heading",
@@ -1448,53 +1521,53 @@ var w = class l {
1448
1521
  "def",
1449
1522
  "paragraph",
1450
1523
  "text"
1451
- ].includes(r.type)) {
1452
- t += o === !1 ? "" : o ?? "";
1524
+ ].includes(o.type)) {
1525
+ t += i === !1 ? "" : i ?? "";
1453
1526
  continue;
1454
1527
  }
1455
1528
  }
1456
- let i = s;
1457
- switch (i.type) {
1529
+ let s = r;
1530
+ switch (s.type) {
1458
1531
  case "space":
1459
- t += this.renderer.space(i);
1532
+ t += this.renderer.space(s);
1460
1533
  break;
1461
1534
  case "hr":
1462
- t += this.renderer.hr(i);
1535
+ t += this.renderer.hr(s);
1463
1536
  break;
1464
1537
  case "heading":
1465
- t += this.renderer.heading(i);
1538
+ t += this.renderer.heading(s);
1466
1539
  break;
1467
1540
  case "code":
1468
- t += this.renderer.code(i);
1541
+ t += this.renderer.code(s);
1469
1542
  break;
1470
1543
  case "table":
1471
- t += this.renderer.table(i);
1544
+ t += this.renderer.table(s);
1472
1545
  break;
1473
1546
  case "blockquote":
1474
- t += this.renderer.blockquote(i);
1547
+ t += this.renderer.blockquote(s);
1475
1548
  break;
1476
1549
  case "list":
1477
- t += this.renderer.list(i);
1550
+ t += this.renderer.list(s);
1478
1551
  break;
1479
1552
  case "checkbox":
1480
- t += this.renderer.checkbox(i);
1553
+ t += this.renderer.checkbox(s);
1481
1554
  break;
1482
1555
  case "html":
1483
- t += this.renderer.html(i);
1556
+ t += this.renderer.html(s);
1484
1557
  break;
1485
1558
  case "def":
1486
- t += this.renderer.def(i);
1559
+ t += this.renderer.def(s);
1487
1560
  break;
1488
1561
  case "paragraph":
1489
- t += this.renderer.paragraph(i);
1562
+ t += this.renderer.paragraph(s);
1490
1563
  break;
1491
1564
  case "text":
1492
- t += this.renderer.text(i);
1565
+ t += this.renderer.text(s);
1493
1566
  break;
1494
1567
  default: {
1495
- let r = "Token with \"" + i.type + "\" type was not found.";
1496
- if (this.options.silent) return console.error(r), "";
1497
- throw new Error(r);
1568
+ let o = "Token with \"" + s.type + "\" type was not found.";
1569
+ if (this.options.silent) return console.error(o), "";
1570
+ throw new Error(o);
1498
1571
  }
1499
1572
  }
1500
1573
  }
@@ -1503,11 +1576,11 @@ var w = class l {
1503
1576
  parseInline(e, t = this.renderer) {
1504
1577
  this.renderer.parser = this;
1505
1578
  let n = "";
1506
- for (let s = 0; s < e.length; s++) {
1507
- let i = e[s];
1508
- if (this.options.extensions?.renderers?.[i.type]) {
1509
- let o = this.options.extensions.renderers[i.type].call({ parser: this }, i);
1510
- if (o !== !1 || ![
1579
+ for (let r = 0; r < e.length; r++) {
1580
+ let s = e[r];
1581
+ if (this.options.extensions?.renderers?.[s.type]) {
1582
+ let i = this.options.extensions.renderers[s.type].call({ parser: this }, s);
1583
+ if (i !== !1 || ![
1511
1584
  "escape",
1512
1585
  "html",
1513
1586
  "link",
@@ -1519,61 +1592,61 @@ var w = class l {
1519
1592
  "br",
1520
1593
  "del",
1521
1594
  "text"
1522
- ].includes(i.type)) {
1523
- n += o === !1 ? "" : o ?? "";
1595
+ ].includes(s.type)) {
1596
+ n += i === !1 ? "" : i ?? "";
1524
1597
  continue;
1525
1598
  }
1526
1599
  }
1527
- let r = i;
1528
- switch (r.type) {
1600
+ let o = s;
1601
+ switch (o.type) {
1529
1602
  case "escape":
1530
- n += t.text(r);
1603
+ n += t.text(o);
1531
1604
  break;
1532
1605
  case "html":
1533
- n += t.html(r);
1606
+ n += t.html(o);
1534
1607
  break;
1535
1608
  case "link":
1536
- n += t.link(r);
1609
+ n += t.link(o);
1537
1610
  break;
1538
1611
  case "image":
1539
- n += t.image(r);
1612
+ n += t.image(o);
1540
1613
  break;
1541
1614
  case "checkbox":
1542
- n += t.checkbox(r);
1615
+ n += t.checkbox(o);
1543
1616
  break;
1544
1617
  case "strong":
1545
- n += t.strong(r);
1618
+ n += t.strong(o);
1546
1619
  break;
1547
1620
  case "em":
1548
- n += t.em(r);
1621
+ n += t.em(o);
1549
1622
  break;
1550
1623
  case "codespan":
1551
- n += t.codespan(r);
1624
+ n += t.codespan(o);
1552
1625
  break;
1553
1626
  case "br":
1554
- n += t.br(r);
1627
+ n += t.br(o);
1555
1628
  break;
1556
1629
  case "del":
1557
- n += t.del(r);
1630
+ n += t.del(o);
1558
1631
  break;
1559
1632
  case "text":
1560
- n += t.text(r);
1633
+ n += t.text(o);
1561
1634
  break;
1562
1635
  default: {
1563
- let o = "Token with \"" + r.type + "\" type was not found.";
1564
- if (this.options.silent) return console.error(o), "";
1565
- throw new Error(o);
1636
+ let i = "Token with \"" + o.type + "\" type was not found.";
1637
+ if (this.options.silent) return console.error(i), "";
1638
+ throw new Error(i);
1566
1639
  }
1567
1640
  }
1568
1641
  }
1569
1642
  return n;
1570
1643
  }
1571
1644
  };
1572
- var I = class {
1645
+ var A = class {
1573
1646
  options;
1574
1647
  block;
1575
1648
  constructor(e) {
1576
- this.options = e || y;
1649
+ this.options = e || S;
1577
1650
  }
1578
1651
  static passThroughHooks = /* @__PURE__ */ new Set([
1579
1652
  "preprocess",
@@ -1599,50 +1672,50 @@ var I = class {
1599
1672
  return e;
1600
1673
  }
1601
1674
  provideLexer(e = this.block) {
1602
- return e ? O.lex : O.lexInline;
1675
+ return e ? w.lex : w.lexInline;
1603
1676
  }
1604
1677
  provideParser(e = this.block) {
1605
- return e ? w.parse : w.parseInline;
1678
+ return e ? P.parse : P.parseInline;
1606
1679
  }
1607
1680
  };
1608
- function z(l, e) {
1681
+ function M(l, e) {
1609
1682
  if (Array.isArray(e)) for (let t = 0; t < e.length; t++) l.push(e[t]);
1610
1683
  else l.push(e);
1611
1684
  }
1612
- var Y = class {
1613
- defaults = j();
1685
+ var ne = class {
1686
+ defaults = G();
1614
1687
  options = this.setOptions;
1615
1688
  parse = this.parseMarkdown(!0);
1616
1689
  parseInline = this.parseMarkdown(!1);
1617
- Parser = w;
1618
- Renderer = C;
1619
- TextRenderer = E;
1620
- Lexer = O;
1690
+ Parser = P;
1691
+ Renderer = I;
1692
+ TextRenderer = z;
1693
+ Lexer = w;
1621
1694
  Tokenizer = _;
1622
- Hooks = I;
1695
+ Hooks = A;
1623
1696
  constructor(...e) {
1624
1697
  this.use(...e);
1625
1698
  }
1626
1699
  walkTokens(e, t) {
1627
1700
  let n = [];
1628
- for (let s of e) switch (z(n, t.call(this, s)), s.type) {
1701
+ for (let r of e) switch (M(n, t.call(this, r)), r.type) {
1629
1702
  case "table": {
1630
- let i = s;
1631
- for (let r of i.header) z(n, this.walkTokens(r.tokens, t));
1632
- for (let r of i.rows) for (let o of r) z(n, this.walkTokens(o.tokens, t));
1703
+ let s = r;
1704
+ for (let o of s.header) M(n, this.walkTokens(o.tokens, t));
1705
+ for (let o of s.rows) for (let i of o) M(n, this.walkTokens(i.tokens, t));
1633
1706
  break;
1634
1707
  }
1635
1708
  case "list": {
1636
- let i = s;
1637
- z(n, this.walkTokens(i.items, t));
1709
+ let s = r;
1710
+ M(n, this.walkTokens(s.items, t));
1638
1711
  break;
1639
1712
  }
1640
1713
  default: {
1641
- let i = s;
1642
- this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((r) => {
1643
- let o = i[r].flat(1 / 0);
1644
- z(n, this.walkTokens(o, t));
1645
- }) : i.tokens && z(n, this.walkTokens(i.tokens, t));
1714
+ let s = r;
1715
+ this.defaults.extensions?.childTokens?.[s.type] ? this.defaults.extensions.childTokens[s.type].forEach((o) => {
1716
+ let i = s[o].flat(1 / 0);
1717
+ M(n, this.walkTokens(i, t));
1718
+ }) : s.tokens && M(n, this.walkTokens(s.tokens, t));
1646
1719
  }
1647
1720
  }
1648
1721
  return n;
@@ -1653,86 +1726,86 @@ var Y = class {
1653
1726
  childTokens: Object.create(null)
1654
1727
  };
1655
1728
  return e.forEach((n) => {
1656
- let s = { ...n };
1657
- if (s.async = this.defaults.async || s.async || !1, n.extensions && (n.extensions.forEach((i) => {
1658
- if (!i.name) throw new Error("extension name required");
1659
- if ("renderer" in i) {
1660
- let r = t.renderers[i.name];
1661
- r ? t.renderers[i.name] = function(...o) {
1662
- let a = i.renderer.apply(this, o);
1663
- return a === !1 && (a = r.apply(this, o)), a;
1664
- } : t.renderers[i.name] = i.renderer;
1729
+ let r = { ...n };
1730
+ if (r.async = this.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach((s) => {
1731
+ if (!s.name) throw new Error("extension name required");
1732
+ if ("renderer" in s) {
1733
+ let o = t.renderers[s.name];
1734
+ o ? t.renderers[s.name] = function(...i) {
1735
+ let a = s.renderer.apply(this, i);
1736
+ return a === !1 && (a = o.apply(this, i)), a;
1737
+ } : t.renderers[s.name] = s.renderer;
1665
1738
  }
1666
- if ("tokenizer" in i) {
1667
- if (!i.level || i.level !== "block" && i.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
1668
- let r = t[i.level];
1669
- 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]));
1739
+ if ("tokenizer" in s) {
1740
+ if (!s.level || s.level !== "block" && s.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
1741
+ let o = t[s.level];
1742
+ o ? o.unshift(s.tokenizer) : t[s.level] = [s.tokenizer], s.start && (s.level === "block" ? t.startBlock ? t.startBlock.push(s.start) : t.startBlock = [s.start] : s.level === "inline" && (t.startInline ? t.startInline.push(s.start) : t.startInline = [s.start]));
1670
1743
  }
1671
- "childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
1672
- }), s.extensions = t), n.renderer) {
1673
- let i = this.defaults.renderer || new C(this.defaults);
1674
- for (let r in n.renderer) {
1675
- if (!(r in i)) throw new Error(`renderer '${r}' does not exist`);
1676
- if (["options", "parser"].includes(r)) continue;
1677
- let o = r, a = n.renderer[o], p = i[o];
1678
- i[o] = (...c) => {
1679
- let u = a.apply(i, c);
1680
- return u === !1 && (u = p.apply(i, c)), u === !1 ? "" : u ?? "";
1744
+ "childTokens" in s && s.childTokens && (t.childTokens[s.name] = s.childTokens);
1745
+ }), r.extensions = t), n.renderer) {
1746
+ let s = this.defaults.renderer || new I(this.defaults);
1747
+ for (let o in n.renderer) {
1748
+ if (!(o in s)) throw new Error(`renderer '${o}' does not exist`);
1749
+ if (["options", "parser"].includes(o)) continue;
1750
+ let i = o, a = n.renderer[i], c = s[i];
1751
+ s[i] = (...u) => {
1752
+ let d = a.apply(s, u);
1753
+ return d === !1 && (d = c.apply(s, u)), d === !1 ? "" : d ?? "";
1681
1754
  };
1682
1755
  }
1683
- s.renderer = i;
1756
+ r.renderer = s;
1684
1757
  }
1685
1758
  if (n.tokenizer) {
1686
- let i = this.defaults.tokenizer || new _(this.defaults);
1687
- for (let r in n.tokenizer) {
1688
- if (!(r in i)) throw new Error(`tokenizer '${r}' does not exist`);
1759
+ let s = this.defaults.tokenizer || new _(this.defaults);
1760
+ for (let o in n.tokenizer) {
1761
+ if (!(o in s)) throw new Error(`tokenizer '${o}' does not exist`);
1689
1762
  if ([
1690
1763
  "options",
1691
1764
  "rules",
1692
1765
  "lexer"
1693
- ].includes(r)) continue;
1694
- let o = r, a = n.tokenizer[o], p = i[o];
1695
- i[o] = (...c) => {
1696
- let u = a.apply(i, c);
1697
- return u === !1 && (u = p.apply(i, c)), u;
1766
+ ].includes(o)) continue;
1767
+ let i = o, a = n.tokenizer[i], c = s[i];
1768
+ s[i] = (...u) => {
1769
+ let d = a.apply(s, u);
1770
+ return d === !1 && (d = c.apply(s, u)), d;
1698
1771
  };
1699
1772
  }
1700
- s.tokenizer = i;
1773
+ r.tokenizer = s;
1701
1774
  }
1702
1775
  if (n.hooks) {
1703
- let i = this.defaults.hooks || new I();
1704
- for (let r in n.hooks) {
1705
- if (!(r in i)) throw new Error(`hook '${r}' does not exist`);
1706
- if (["options", "block"].includes(r)) continue;
1707
- let o = r, a = n.hooks[o], p = i[o];
1708
- I.passThroughHooks.has(r) ? i[o] = (c) => {
1709
- if (i.options.async && I.passThroughHooksRespectAsync.has(r)) return (async () => {
1710
- let d = await a.call(i, c);
1711
- return p.call(i, d);
1776
+ let s = this.defaults.hooks || new A();
1777
+ for (let o in n.hooks) {
1778
+ if (!(o in s)) throw new Error(`hook '${o}' does not exist`);
1779
+ if (["options", "block"].includes(o)) continue;
1780
+ let i = o, a = n.hooks[i], c = s[i];
1781
+ A.passThroughHooks.has(o) ? s[i] = (u) => {
1782
+ if (s.options.async && A.passThroughHooksRespectAsync.has(o)) return (async () => {
1783
+ let h = await a.call(s, u);
1784
+ return c.call(s, h);
1712
1785
  })();
1713
- let u = a.call(i, c);
1714
- return p.call(i, u);
1715
- } : i[o] = (...c) => {
1716
- if (i.options.async) return (async () => {
1717
- let d = await a.apply(i, c);
1718
- return d === !1 && (d = await p.apply(i, c)), d;
1786
+ let d = a.call(s, u);
1787
+ return c.call(s, d);
1788
+ } : s[i] = (...u) => {
1789
+ if (s.options.async) return (async () => {
1790
+ let h = await a.apply(s, u);
1791
+ return h === !1 && (h = await c.apply(s, u)), h;
1719
1792
  })();
1720
- let u = a.apply(i, c);
1721
- return u === !1 && (u = p.apply(i, c)), u;
1793
+ let d = a.apply(s, u);
1794
+ return d === !1 && (d = c.apply(s, u)), d;
1722
1795
  };
1723
1796
  }
1724
- s.hooks = i;
1797
+ r.hooks = s;
1725
1798
  }
1726
1799
  if (n.walkTokens) {
1727
- let i = this.defaults.walkTokens, r = n.walkTokens;
1728
- s.walkTokens = function(o) {
1800
+ let s = this.defaults.walkTokens, o = n.walkTokens;
1801
+ r.walkTokens = function(i) {
1729
1802
  let a = [];
1730
- return z(a, r.call(this, o)), i && z(a, i.call(this, o)), a;
1803
+ return M(a, o.call(this, i)), s && M(a, s.call(this, i)), a;
1731
1804
  };
1732
1805
  }
1733
1806
  this.defaults = {
1734
1807
  ...this.defaults,
1735
- ...s
1808
+ ...r
1736
1809
  };
1737
1810
  }), this;
1738
1811
  }
@@ -1743,34 +1816,34 @@ var Y = class {
1743
1816
  }, this;
1744
1817
  }
1745
1818
  lexer(e, t) {
1746
- return O.lex(e, t ?? this.defaults);
1819
+ return w.lex(e, t ?? this.defaults);
1747
1820
  }
1748
1821
  parser(e, t) {
1749
- return w.parse(e, t ?? this.defaults);
1822
+ return P.parse(e, t ?? this.defaults);
1750
1823
  }
1751
1824
  parseMarkdown(e) {
1752
- return (n, s) => {
1753
- let i = { ...s }, r = {
1825
+ return (n, r) => {
1826
+ let s = { ...r }, o = {
1754
1827
  ...this.defaults,
1755
- ...i
1756
- }, o = this.onError(!!r.silent, !!r.async);
1757
- if (this.defaults.async === !0 && i.async === !1) return o(/* @__PURE__ */ 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."));
1758
- if (typeof n > "u" || n === null) return o(/* @__PURE__ */ new Error("marked(): input parameter is undefined or null"));
1759
- if (typeof n != "string") return o(/* @__PURE__ */ new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1760
- if (r.hooks && (r.hooks.options = r, r.hooks.block = e), r.async) return (async () => {
1761
- let a = r.hooks ? await r.hooks.preprocess(n) : n, c = await (r.hooks ? await r.hooks.provideLexer(e) : e ? O.lex : O.lexInline)(a, r), u = r.hooks ? await r.hooks.processAllTokens(c) : c;
1762
- r.walkTokens && await Promise.all(this.walkTokens(u, r.walkTokens));
1763
- let k = await (r.hooks ? await r.hooks.provideParser(e) : e ? w.parse : w.parseInline)(u, r);
1764
- return r.hooks ? await r.hooks.postprocess(k) : k;
1765
- })().catch(o);
1828
+ ...s
1829
+ }, i = this.onError(!!o.silent, !!o.async);
1830
+ if (this.defaults.async === !0 && s.async === !1) return i(/* @__PURE__ */ 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."));
1831
+ if (typeof n > "u" || n === null) return i(/* @__PURE__ */ new Error("marked(): input parameter is undefined or null"));
1832
+ if (typeof n != "string") return i(/* @__PURE__ */ new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1833
+ if (o.hooks && (o.hooks.options = o, o.hooks.block = e), o.async) return (async () => {
1834
+ let a = o.hooks ? await o.hooks.preprocess(n) : n, u = await (o.hooks ? await o.hooks.provideLexer(e) : e ? w.lex : w.lexInline)(a, o), d = o.hooks ? await o.hooks.processAllTokens(u) : u;
1835
+ o.walkTokens && await Promise.all(this.walkTokens(d, o.walkTokens));
1836
+ let p = await (o.hooks ? await o.hooks.provideParser(e) : e ? P.parse : P.parseInline)(d, o);
1837
+ return o.hooks ? await o.hooks.postprocess(p) : p;
1838
+ })().catch(i);
1766
1839
  try {
1767
- r.hooks && (n = r.hooks.preprocess(n));
1768
- let p = (r.hooks ? r.hooks.provideLexer(e) : e ? O.lex : O.lexInline)(n, r);
1769
- r.hooks && (p = r.hooks.processAllTokens(p)), r.walkTokens && this.walkTokens(p, r.walkTokens);
1770
- let u = (r.hooks ? r.hooks.provideParser(e) : e ? w.parse : w.parseInline)(p, r);
1771
- return r.hooks && (u = r.hooks.postprocess(u)), u;
1840
+ o.hooks && (n = o.hooks.preprocess(n));
1841
+ let c = (o.hooks ? o.hooks.provideLexer(e) : e ? w.lex : w.lexInline)(n, o);
1842
+ o.hooks && (c = o.hooks.processAllTokens(c)), o.walkTokens && this.walkTokens(c, o.walkTokens);
1843
+ let d = (o.hooks ? o.hooks.provideParser(e) : e ? P.parse : P.parseInline)(c, o);
1844
+ return o.hooks && (d = o.hooks.postprocess(d)), d;
1772
1845
  } catch (a) {
1773
- return o(a);
1846
+ return i(a);
1774
1847
  }
1775
1848
  };
1776
1849
  }
@@ -1778,44 +1851,44 @@ var Y = class {
1778
1851
  return (n) => {
1779
1852
  if (n.message += `
1780
1853
  Please report this to https://github.com/markedjs/marked.`, e) {
1781
- let s = "<p>An error occurred:</p><pre>" + P(n.message + "", !0) + "</pre>";
1782
- return t ? Promise.resolve(s) : s;
1854
+ let r = "<p>An error occurred:</p><pre>" + y(n.message + "", !0) + "</pre>";
1855
+ return t ? Promise.resolve(r) : r;
1783
1856
  }
1784
1857
  if (t) return Promise.reject(n);
1785
1858
  throw n;
1786
1859
  };
1787
1860
  }
1788
1861
  };
1789
- var q = new Y();
1862
+ var v = new ne();
1790
1863
  function x(l, e) {
1791
- return q.parse(l, e);
1864
+ return v.parse(l, e);
1792
1865
  }
1793
1866
  x.options = x.setOptions = function(l) {
1794
- return q.setOptions(l), x.defaults = q.defaults, ie(x.defaults), x;
1867
+ return v.setOptions(l), x.defaults = v.defaults, ue(x.defaults), x;
1795
1868
  };
1796
- x.getDefaults = j;
1797
- x.defaults = y;
1798
- function vt(...l) {
1799
- return q.use(...l), x.defaults = q.defaults, ie(x.defaults), x;
1869
+ x.getDefaults = G;
1870
+ x.defaults = S;
1871
+ function jt(...l) {
1872
+ return v.use(...l), x.defaults = v.defaults, ue(x.defaults), x;
1800
1873
  }
1801
- x.use = vt;
1874
+ x.use = jt;
1802
1875
  x.walkTokens = function(l, e) {
1803
- return q.walkTokens(l, e);
1876
+ return v.walkTokens(l, e);
1804
1877
  };
1805
- x.parseInline = q.parseInline;
1806
- x.Parser = w;
1807
- x.parser = w.parse;
1808
- x.Renderer = C;
1809
- x.TextRenderer = E;
1810
- x.Lexer = O;
1811
- x.lexer = O.lex;
1878
+ x.parseInline = v.parseInline;
1879
+ x.Parser = P;
1880
+ x.parser = P.parse;
1881
+ x.Renderer = I;
1882
+ x.TextRenderer = z;
1883
+ x.Lexer = w;
1884
+ x.lexer = w.lex;
1812
1885
  x.Tokenizer = _;
1813
- x.Hooks = I;
1886
+ x.Hooks = A;
1814
1887
  x.parse = x;
1815
1888
  x.options;
1816
1889
  x.setOptions;
1817
1890
  x.walkTokens;
1818
1891
  x.parseInline;
1819
- w.parse;
1820
- O.lex;
1821
- export { O as t };
1892
+ P.parse;
1893
+ w.lex;
1894
+ export { w as t };