/i.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
+ type: "html",
+ raw: t[0],
+ inLink: this.lexer.state.inLink,
+ inRawBlock: this.lexer.state.inRawBlock,
+ block: !1,
+ text: t[0]
+ };
+ }
+ link(e) {
+ const t = this.rules.inline.link.exec(e);
+ if (t) {
+ const r = t[2].trim();
+ if (!this.options.pedantic && /^$/.test(r))
+ return;
+ const d = rtrim(r.slice(0, -1), "\\");
+ if ((r.length - d.length) % 2 === 0)
+ return;
+ } else {
+ const d = findClosingBracket(t[2], "()");
+ if (d > -1) {
+ const u = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + d;
+ t[2] = t[2].substring(0, d), t[0] = t[0].substring(0, u).trim(), t[3] = "";
+ }
+ }
+ let a = t[2], l = "";
+ if (this.options.pedantic) {
+ const d = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(a);
+ d && (a = d[1], l = d[3]);
+ } else
+ l = t[3] ? t[3].slice(1, -1) : "";
+ return a = a.trim(), /^$/.test(r) ? a = a.slice(1) : a = a.slice(1, -1)), outputLink(t, {
+ href: a && a.replace(this.rules.inline.anyPunctuation, "$1"),
+ title: l && l.replace(this.rules.inline.anyPunctuation, "$1")
+ }, t[0], this.lexer);
+ }
+ }
+ reflink(e, t) {
+ let r;
+ if ((r = this.rules.inline.reflink.exec(e)) || (r = this.rules.inline.nolink.exec(e))) {
+ const a = (r[2] || r[1]).replace(/\s+/g, " "), l = t[a.toLowerCase()];
+ if (!l) {
+ const d = r[0].charAt(0);
+ return {
+ type: "text",
+ raw: d,
+ text: d
+ };
+ }
+ return outputLink(r, l, r[0], this.lexer);
+ }
+ }
+ emStrong(e, t, r = "") {
+ let a = this.rules.inline.emStrongLDelim.exec(e);
+ if (!a || a[3] && r.match(/[\p{L}\p{N}]/u))
+ return;
+ if (!(a[1] || a[2] || "") || !r || this.rules.inline.punctuation.exec(r)) {
+ const d = [...a[0]].length - 1;
+ let o, u, p = d, m = 0;
+ const y = a[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
+ for (y.lastIndex = 0, t = t.slice(-1 * e.length + d); (a = y.exec(t)) != null; ) {
+ if (o = a[1] || a[2] || a[3] || a[4] || a[5] || a[6], !o)
+ continue;
+ if (u = [...o].length, a[3] || a[4]) {
+ p += u;
+ continue;
+ } else if ((a[5] || a[6]) && d % 3 && !((d + u) % 3)) {
+ m += u;
+ continue;
+ }
+ if (p -= u, p > 0)
+ continue;
+ u = Math.min(u, u + p + m);
+ const w = [...a[0]][0].length, b = e.slice(0, d + a.index + w + u);
+ if (Math.min(d, u) % 2) {
+ const f = b.slice(1, -1);
+ return {
+ type: "em",
+ raw: b,
+ text: f,
+ tokens: this.lexer.inlineTokens(f)
+ };
+ }
+ const A = b.slice(2, -2);
+ return {
+ type: "strong",
+ raw: b,
+ text: A,
+ tokens: this.lexer.inlineTokens(A)
+ };
+ }
+ }
+ }
+ codespan(e) {
+ const t = this.rules.inline.code.exec(e);
+ if (t) {
+ let r = t[2].replace(/\n/g, " ");
+ const a = /[^ ]/.test(r), l = /^ /.test(r) && / $/.test(r);
+ return a && l && (r = r.substring(1, r.length - 1)), r = escape$1(r, !0), {
+ type: "codespan",
+ raw: t[0],
+ text: r
+ };
+ }
+ }
+ br(e) {
+ const t = this.rules.inline.br.exec(e);
+ if (t)
+ return {
+ type: "br",
+ raw: t[0]
+ };
+ }
+ del(e) {
+ const t = this.rules.inline.del.exec(e);
+ if (t)
+ return {
+ type: "del",
+ raw: t[0],
+ text: t[2],
+ tokens: this.lexer.inlineTokens(t[2])
+ };
+ }
+ autolink(e) {
+ const t = this.rules.inline.autolink.exec(e);
+ if (t) {
+ let r, a;
+ return t[2] === "@" ? (r = escape$1(t[1]), a = "mailto:" + r) : (r = escape$1(t[1]), a = r), {
+ type: "link",
+ raw: t[0],
+ text: r,
+ href: a,
+ tokens: [
+ {
+ type: "text",
+ raw: r,
+ text: r
+ }
+ ]
+ };
+ }
+ }
+ url(e) {
+ var r;
+ let t;
+ if (t = this.rules.inline.url.exec(e)) {
+ let a, l;
+ if (t[2] === "@")
+ a = escape$1(t[0]), l = "mailto:" + a;
+ else {
+ let d;
+ do
+ d = t[0], t[0] = ((r = this.rules.inline._backpedal.exec(t[0])) == null ? void 0 : r[0]) ?? "";
+ while (d !== t[0]);
+ a = escape$1(t[0]), t[1] === "www." ? l = "http://" + t[0] : l = t[0];
+ }
+ return {
+ type: "link",
+ raw: t[0],
+ text: a,
+ href: l,
+ tokens: [
+ {
+ type: "text",
+ raw: a,
+ text: a
+ }
+ ]
+ };
+ }
+ }
+ inlineText(e) {
+ const t = this.rules.inline.text.exec(e);
+ if (t) {
+ let r;
+ return this.lexer.state.inRawBlock ? r = t[0] : r = escape$1(t[0]), {
+ type: "text",
+ raw: t[0],
+ text: r
+ };
+ }
+ }
+}
+const newline = /^(?: *(?:\n|$))+/, blockCode = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, bullet = /(?:[*+-]|\d{1,9}[.)])/, lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, bullet).replace(/blockCode/g, / {4}/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, blockText = /^[^\n]+/, _blockLabel = /(?!\s*\])(?:\\.|[^\[\]\\])+/, def = edit(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", _blockLabel).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), list = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bullet).getRegex(), _tag = "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", _comment = /|$))/, html$2 = edit("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", "i").replace("comment", _comment).replace("tag", _tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), paragraph = edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex(), blockquote = edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", paragraph).getRegex(), blockNormal = {
+ blockquote,
+ code: blockCode,
+ def,
+ fences,
+ heading,
+ hr,
+ html: html$2,
+ lheading,
+ list,
+ newline,
+ paragraph,
+ table: noopTest,
+ text: blockText
+}, gfmTable = edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex(), blockGfm = {
+ ...blockNormal,
+ table: gfmTable,
+ paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", gfmTable).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex()
+}, blockPedantic = {
+ ...blockNormal,
+ html: edit(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", _comment).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(),
+ def: /^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
+ fences: noopTest,
+ // fences not supported
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
+ paragraph: edit(_paragraph).replace("hr", hr).replace("heading", ` *#{1,6} *[^
+]`).replace("lheading", lheading).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
+}, escape = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, inlineCode = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, br = /^( {2,}|\\)\n(?!\s*$)/, inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g, emStrongLDelim = edit(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, _punctuation).getRegex(), emStrongRDelimAst = edit("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, _punctuation).getRegex(), emStrongRDelimUnd = edit("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, _punctuation).getRegex(), anyPunctuation = edit(/\\([punct])/, "gu").replace(/punct/g, _punctuation).getRegex(), autolink = edit(/^<(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(), _inlineComment = edit(_comment).replace("(?:-->|$)", "-->").getRegex(), tag = edit("^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment", _inlineComment).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), _inlineLabel = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, link = edit(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", _inlineLabel).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), reflink = edit(/^!?\[(label)\]\[(ref)\]/).replace("label", _inlineLabel).replace("ref", _blockLabel).getRegex(), nolink = edit(/^!?\[(ref)\](?:\[\])?/).replace("ref", _blockLabel).getRegex(), reflinkSearch = edit("reflink|nolink(?!\\()", "g").replace("reflink", reflink).replace("nolink", nolink).getRegex(), inlineNormal = {
+ _backpedal: noopTest,
+ // only used for GFM url
+ anyPunctuation,
+ autolink,
+ blockSkip,
+ br,
+ code: inlineCode,
+ del: noopTest,
+ emStrongLDelim,
+ emStrongRDelimAst,
+ emStrongRDelimUnd,
+ escape,
+ link,
+ nolink,
+ punctuation,
+ reflink,
+ reflinkSearch,
+ tag,
+ text: inlineText,
+ url: noopTest
+}, inlinePedantic = {
+ ...inlineNormal,
+ link: edit(/^!?\[(label)\]\((.*?)\)/).replace("label", _inlineLabel).getRegex(),
+ reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", _inlineLabel).getRegex()
+}, inlineGfm = {
+ ...inlineNormal,
+ escape: edit(escape).replace("])", "~|])").getRegex(),
+ url: edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
+ del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
+ text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\ u + " ".repeat(p.length));
+ let r, a, l, d;
+ for (; e; )
+ if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((o) => (r = o.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1))) {
+ if (r = this.tokenizer.space(e)) {
+ e = e.substring(r.raw.length), r.raw.length === 1 && t.length > 0 ? t[t.length - 1].raw += `
+` : t.push(r);
+ continue;
+ }
+ if (r = this.tokenizer.code(e)) {
+ e = e.substring(r.raw.length), a = t[t.length - 1], a && (a.type === "paragraph" || a.type === "text") ? (a.raw += `
+` + r.raw, a.text += `
+` + r.text, this.inlineQueue[this.inlineQueue.length - 1].src = a.text) : t.push(r);
+ continue;
+ }
+ if (r = this.tokenizer.fences(e)) {
+ e = e.substring(r.raw.length), t.push(r);
+ continue;
+ }
+ if (r = this.tokenizer.heading(e)) {
+ e = e.substring(r.raw.length), t.push(r);
+ continue;
+ }
+ if (r = this.tokenizer.hr(e)) {
+ e = e.substring(r.raw.length), t.push(r);
+ continue;
+ }
+ if (r = this.tokenizer.blockquote(e)) {
+ e = e.substring(r.raw.length), t.push(r);
+ continue;
+ }
+ if (r = this.tokenizer.list(e)) {
+ e = e.substring(r.raw.length), t.push(r);
+ continue;
+ }
+ if (r = this.tokenizer.html(e)) {
+ e = e.substring(r.raw.length), t.push(r);
+ continue;
+ }
+ if (r = this.tokenizer.def(e)) {
+ e = e.substring(r.raw.length), a = t[t.length - 1], a && (a.type === "paragraph" || a.type === "text") ? (a.raw += `
+` + r.raw, a.text += `
+` + r.raw, this.inlineQueue[this.inlineQueue.length - 1].src = a.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
+ href: r.href,
+ title: r.title
+ });
+ continue;
+ }
+ if (r = this.tokenizer.table(e)) {
+ e = e.substring(r.raw.length), t.push(r);
+ continue;
+ }
+ if (r = this.tokenizer.lheading(e)) {
+ e = e.substring(r.raw.length), t.push(r);
+ continue;
+ }
+ if (l = e, this.options.extensions && this.options.extensions.startBlock) {
+ let o = 1 / 0;
+ const u = e.slice(1);
+ let p;
+ this.options.extensions.startBlock.forEach((m) => {
+ p = m.call({ lexer: this }, u), typeof p == "number" && p >= 0 && (o = Math.min(o, p));
+ }), o < 1 / 0 && o >= 0 && (l = e.substring(0, o + 1));
+ }
+ if (this.state.top && (r = this.tokenizer.paragraph(l))) {
+ a = t[t.length - 1], d && a.type === "paragraph" ? (a.raw += `
+` + r.raw, a.text += `
+` + r.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = a.text) : t.push(r), d = l.length !== e.length, e = e.substring(r.raw.length);
+ continue;
+ }
+ if (r = this.tokenizer.text(e)) {
+ e = e.substring(r.raw.length), a = t[t.length - 1], a && a.type === "text" ? (a.raw += `
+` + r.raw, a.text += `
+` + r.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = a.text) : t.push(r);
+ continue;
+ }
+ if (e) {
+ const o = "Infinite loop on byte: " + e.charCodeAt(0);
+ if (this.options.silent) {
+ console.error(o);
+ break;
+ } else
+ throw new Error(o);
+ }
+ }
+ return this.state.top = !0, t;
+ }
+ inline(e, t = []) {
+ return this.inlineQueue.push({ src: e, tokens: t }), t;
+ }
+ /**
+ * Lexing/Compiling
+ */
+ inlineTokens(e, t = []) {
+ let r, a, l, d = e, o, u, p;
+ if (this.tokens.links) {
+ const m = Object.keys(this.tokens.links);
+ if (m.length > 0)
+ for (; (o = this.tokenizer.rules.inline.reflinkSearch.exec(d)) != null; )
+ m.includes(o[0].slice(o[0].lastIndexOf("[") + 1, -1)) && (d = d.slice(0, o.index) + "[" + "a".repeat(o[0].length - 2) + "]" + d.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
+ }
+ for (; (o = this.tokenizer.rules.inline.blockSkip.exec(d)) != null; )
+ d = d.slice(0, o.index) + "[" + "a".repeat(o[0].length - 2) + "]" + d.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
+ for (; (o = this.tokenizer.rules.inline.anyPunctuation.exec(d)) != null; )
+ d = d.slice(0, o.index) + "++" + d.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
+ for (; e; )
+ if (u || (p = ""), u = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((m) => (r = m.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1))) {
+ if (r = this.tokenizer.escape(e)) {
+ e = e.substring(r.raw.length), t.push(r);
+ continue;
+ }
+ if (r = this.tokenizer.tag(e)) {
+ e = e.substring(r.raw.length), a = t[t.length - 1], a && r.type === "text" && a.type === "text" ? (a.raw += r.raw, a.text += r.text) : t.push(r);
+ continue;
+ }
+ if (r = this.tokenizer.link(e)) {
+ e = e.substring(r.raw.length), t.push(r);
+ continue;
+ }
+ if (r = this.tokenizer.reflink(e, this.tokens.links)) {
+ e = e.substring(r.raw.length), a = t[t.length - 1], a && r.type === "text" && a.type === "text" ? (a.raw += r.raw, a.text += r.text) : t.push(r);
+ continue;
+ }
+ if (r = this.tokenizer.emStrong(e, d, p)) {
+ e = e.substring(r.raw.length), t.push(r);
+ continue;
+ }
+ if (r = this.tokenizer.codespan(e)) {
+ e = e.substring(r.raw.length), t.push(r);
+ continue;
+ }
+ if (r = this.tokenizer.br(e)) {
+ e = e.substring(r.raw.length), t.push(r);
+ continue;
+ }
+ if (r = this.tokenizer.del(e)) {
+ e = e.substring(r.raw.length), t.push(r);
+ continue;
+ }
+ if (r = this.tokenizer.autolink(e)) {
+ e = e.substring(r.raw.length), t.push(r);
+ continue;
+ }
+ if (!this.state.inLink && (r = this.tokenizer.url(e))) {
+ e = e.substring(r.raw.length), t.push(r);
+ continue;
+ }
+ if (l = e, this.options.extensions && this.options.extensions.startInline) {
+ let m = 1 / 0;
+ const y = e.slice(1);
+ let w;
+ this.options.extensions.startInline.forEach((b) => {
+ w = b.call({ lexer: this }, y), typeof w == "number" && w >= 0 && (m = Math.min(m, w));
+ }), m < 1 / 0 && m >= 0 && (l = e.substring(0, m + 1));
+ }
+ if (r = this.tokenizer.inlineText(l)) {
+ e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (p = r.raw.slice(-1)), u = !0, a = t[t.length - 1], a && a.type === "text" ? (a.raw += r.raw, a.text += r.text) : t.push(r);
+ continue;
+ }
+ if (e) {
+ const m = "Infinite loop on byte: " + e.charCodeAt(0);
+ if (this.options.silent) {
+ console.error(m);
+ break;
+ } else
+ throw new Error(m);
+ }
+ }
+ return t;
+ }
+}
+class _Renderer {
+ constructor(e) {
+ kt(this, "options");
+ this.options = e || _defaults;
+ }
+ code(e, t, r) {
+ var l;
+ const a = (l = (t || "").match(/^\S*/)) == null ? void 0 : l[0];
+ return e = e.replace(/\n$/, "") + `
+`, a ? '' + (r ? e : escape$1(e, !0)) + `
+` : "" + (r ? e : escape$1(e, !0)) + `
+`;
+ }
+ blockquote(e) {
+ return `
+${e}
+`;
+ }
+ html(e, t) {
+ return e;
+ }
+ heading(e, t, r) {
+ return `${e}
+`;
+ }
+ hr() {
+ return `
+`;
+ }
+ list(e, t, r) {
+ const a = t ? "ol" : "ul", l = t && r !== 1 ? ' start="' + r + '"' : "";
+ return "<" + a + l + `>
+` + e + "" + a + `>
+`;
+ }
+ listitem(e, t, r) {
+ return `${e}
+`;
+ }
+ checkbox(e) {
+ return "';
+ }
+ paragraph(e) {
+ return `${e}
+`;
+ }
+ table(e, t) {
+ return t && (t = `${t}`), `