@arcgis/coding-components 5.1.0-next.49 → 5.1.0-next.50

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,9 +1,9 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- function Q() {
2
+ function H() {
3
3
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
4
4
  }
5
- var R = Q();
6
- function se(n) {
5
+ var R = H();
6
+ function le(n) {
7
7
  R = n;
8
8
  }
9
9
  var $ = { exec: () => null };
@@ -14,21 +14,21 @@ function p(n, e = "") {
14
14
  }, getRegex: () => new RegExp(r, e) };
15
15
  return s;
16
16
  }
17
- var be = (() => {
17
+ var xe = (() => {
18
18
  try {
19
19
  return !!new RegExp("(?<=1)(?<!1)");
20
20
  } catch {
21
21
  return !1;
22
22
  }
23
- })(), x = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (n) => new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}#`), htmlBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}<(?:[a-z].*>|!--)`, "i"), blockquoteBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}>`) }, we = /^(?:[ \t]*(?:\n|$))+/, me = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ye = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, P = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, $e = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, H = / {0,3}(?:[*+-]|\d{1,9}[.)])/, le = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ie = p(le).replace(/bull/g, H).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Se = p(le).replace(/bull/g, H).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), N = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Re = /^[^\n]+/, O = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Te = p(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", O).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), ze = p(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, H).getRegex(), C = "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", j = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ae = p("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", j).replace("tag", C).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ae = p(N).replace("hr", P).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[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", C).getRegex(), _e = p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex(), G = { blockquote: _e, code: me, def: Te, fences: ye, heading: $e, hr: P, html: Ae, lheading: ie, list: ze, newline: we, paragraph: ae, table: $, text: Re }, V = p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", C).getRegex(), Pe = { ...G, lheading: Se, table: V, paragraph: p(N).replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", V).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", C).getRegex() }, Ie = { ...G, html: p(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", j).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: $, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: p(N).replace("hr", P).replace("heading", ` *#{1,6} *[^
24
- ]`).replace("lheading", ie).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Le = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, qe = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, oe = /^( {2,}|\\)\n(?!\s*$)/, Be = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, v = /[\p{P}\p{S}]/u, X = /[\s\p{P}\p{S}]/u, ce = /[^\s\p{P}\p{S}]/u, Ce = p(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, X).getRegex(), he = /(?!~)[\p{P}\p{S}]/u, ve = /(?!~)[\s\p{P}\p{S}]/u, Ee = /(?:[^\s\p{P}\p{S}]|~)/u, pe = /(?![*_])[\p{P}\p{S}]/u, Ze = /(?![*_])[\s\p{P}\p{S}]/u, De = /(?:[^\s\p{P}\p{S}]|[*_])/u, Me = p(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", be ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ue = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Qe = p(ue, "u").replace(/punct/g, v).getRegex(), He = p(ue, "u").replace(/punct/g, he).getRegex(), ge = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ne = p(ge, "gu").replace(/notPunctSpace/g, ce).replace(/punctSpace/g, X).replace(/punct/g, v).getRegex(), Oe = p(ge, "gu").replace(/notPunctSpace/g, Ee).replace(/punctSpace/g, ve).replace(/punct/g, he).getRegex(), je = p("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ce).replace(/punctSpace/g, X).replace(/punct/g, v).getRegex(), Ge = p(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, pe).getRegex(), Xe = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", We = p(Xe, "gu").replace(/notPunctSpace/g, De).replace(/punctSpace/g, Ze).replace(/punct/g, pe).getRegex(), Fe = p(/\\(punct)/, "gu").replace(/punct/g, v).getRegex(), Ue = p(/^<(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(), Je = p(j).replace("(?:-->|$)", "-->").getRegex(), Ke = p("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Je).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), L = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Ve = p(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", L).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ke = p(/^!?\[(label)\]\[(ref)\]/).replace("label", L).replace("ref", O).getRegex(), fe = p(/^!?\[(ref)\](?:\[\])?/).replace("ref", O).getRegex(), Ye = p("reflink|nolink(?!\\()", "g").replace("reflink", ke).replace("nolink", fe).getRegex(), Y = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, W = { _backpedal: $, anyPunctuation: Fe, autolink: Ue, blockSkip: Me, br: oe, code: qe, del: $, delLDelim: $, delRDelim: $, emStrongLDelim: Qe, emStrongRDelimAst: Ne, emStrongRDelimUnd: je, escape: Le, link: Ve, nolink: fe, punctuation: Ce, reflink: ke, reflinkSearch: Ye, tag: Ke, text: Be, url: $ }, et = { ...W, link: p(/^!?\[(label)\]\((.*?)\)/).replace("label", L).getRegex(), reflink: p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", L).getRegex() }, Z = { ...W, emStrongRDelimAst: Oe, emStrongLDelim: He, delLDelim: Ge, delRDelim: We, url: p(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Y).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\S]|[^\s~\\]))\1(?=[^~]|$)/, text: p(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Y).getRegex() }, tt = { ...Z, br: p(oe).replace("{2,}", "*").getRegex(), text: p(Z.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, I = { normal: G, gfm: Pe, pedantic: Ie }, z = { normal: W, gfm: Z, breaks: tt, pedantic: et }, rt = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, ee = (n) => rt[n];
23
+ })(), x = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (n) => new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}#`), htmlBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}<(?:[a-z].*>|!--)`, "i"), blockquoteBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}>`) }, be = /^(?:[ \t]*(?:\n|$))+/, we = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, me = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ye = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, N = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ae = p(ie).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), $e = p(ie).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), O = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Se = /^[^\n]+/, j = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Re = p(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", j).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Te = p(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, N).getRegex(), v = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", G = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ze = p("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", G).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), oe = p(O).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), Ae = p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", oe).getRegex(), X = { blockquote: Ae, code: we, def: Re, fences: me, heading: ye, hr: I, html: ze, lheading: ae, list: Te, newline: be, paragraph: oe, table: $, text: Se }, Y = p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), _e = { ...X, lheading: $e, table: Y, paragraph: p(O).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Y).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex() }, Pe = { ...X, html: p(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", G).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: $, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: p(O).replace("hr", I).replace("heading", ` *#{1,6} *[^
24
+ ]`).replace("lheading", ae).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ie = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Le = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ce = /^( {2,}|\\)\n(?!\s*$)/, qe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, T = /[\p{P}\p{S}]/u, E = /[\s\p{P}\p{S}]/u, W = /[^\s\p{P}\p{S}]/u, Be = p(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, E).getRegex(), he = /(?!~)[\p{P}\p{S}]/u, Ce = /(?!~)[\s\p{P}\p{S}]/u, ve = /(?:[^\s\p{P}\p{S}]|~)/u, Ee = p(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", xe ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), pe = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Ze = p(pe, "u").replace(/punct/g, T).getRegex(), De = p(pe, "u").replace(/punct/g, he).getRegex(), ue = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Me = p(ue, "gu").replace(/notPunctSpace/g, W).replace(/punctSpace/g, E).replace(/punct/g, T).getRegex(), Qe = p(ue, "gu").replace(/notPunctSpace/g, ve).replace(/punctSpace/g, Ce).replace(/punct/g, he).getRegex(), He = p("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, W).replace(/punctSpace/g, E).replace(/punct/g, T).getRegex(), Ne = p(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, T).getRegex(), Oe = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", je = p(Oe, "gu").replace(/notPunctSpace/g, W).replace(/punctSpace/g, E).replace(/punct/g, T).getRegex(), Ge = p(/\\(punct)/, "gu").replace(/punct/g, T).getRegex(), Xe = p(/^<(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(), We = p(G).replace("(?:-->|$)", "-->").getRegex(), Fe = p("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", We).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Ue = p(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ge = p(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", j).getRegex(), ke = p(/^!?\[(ref)\](?:\[\])?/).replace("ref", j).getRegex(), Je = p("reflink|nolink(?!\\()", "g").replace("reflink", ge).replace("nolink", ke).getRegex(), ee = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, F = { _backpedal: $, anyPunctuation: Ge, autolink: Xe, blockSkip: Ee, br: ce, code: Le, del: $, delLDelim: $, delRDelim: $, emStrongLDelim: Ze, emStrongRDelimAst: Me, emStrongRDelimUnd: He, escape: Ie, link: Ue, nolink: ke, punctuation: Be, reflink: ge, reflinkSearch: Je, tag: Fe, text: qe, url: $ }, Ke = { ...F, link: p(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() }, D = { ...F, emStrongRDelimAst: Qe, emStrongLDelim: De, delLDelim: Ne, delRDelim: je, url: p(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ee).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\S]|[^\s~\\]))\1(?=[^~]|$)/, text: p(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ee).getRegex() }, Ve = { ...D, br: p(ce).replace("{2,}", "*").getRegex(), text: p(D.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, L = { normal: X, gfm: _e, pedantic: Pe }, A = { normal: F, gfm: D, breaks: Ve, pedantic: Ke }, Ye = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, te = (n) => Ye[n];
25
25
  function m(n, e) {
26
26
  if (e) {
27
- if (x.escapeTest.test(n)) return n.replace(x.escapeReplace, ee);
28
- } else if (x.escapeTestNoEncode.test(n)) return n.replace(x.escapeReplaceNoEncode, ee);
27
+ if (x.escapeTest.test(n)) return n.replace(x.escapeReplace, te);
28
+ } else if (x.escapeTestNoEncode.test(n)) return n.replace(x.escapeReplaceNoEncode, te);
29
29
  return n;
30
30
  }
31
- function te(n) {
31
+ function re(n) {
32
32
  try {
33
33
  n = encodeURI(n).replace(x.percentDecode, "%");
34
34
  } catch {
@@ -36,7 +36,7 @@ function te(n) {
36
36
  }
37
37
  return n;
38
38
  }
39
- function re(n, e) {
39
+ function ne(n, e) {
40
40
  let r = n.replace(x.findPipe, (i, l, o) => {
41
41
  let a = !1, h = l;
42
42
  for (; --h >= 0 && o[h] === "\\"; ) a = !a;
@@ -47,7 +47,7 @@ function re(n, e) {
47
47
  for (; t < s.length; t++) s[t] = s[t].trim().replace(x.slashPipe, "|");
48
48
  return s;
49
49
  }
50
- function A(n, e, r) {
50
+ function _(n, e, r) {
51
51
  let s = n.length;
52
52
  if (s === 0) return "";
53
53
  let t = 0;
@@ -55,7 +55,7 @@ function A(n, e, r) {
55
55
  t++;
56
56
  return n.slice(0, s - t);
57
57
  }
58
- function nt(n, e) {
58
+ function et(n, e) {
59
59
  if (n.indexOf(e[1]) === -1) return -1;
60
60
  let r = 0;
61
61
  for (let s = 0; s < n.length; s++) if (n[s] === "\\") s++;
@@ -63,7 +63,7 @@ function nt(n, e) {
63
63
  else if (n[s] === e[1] && (r--, r < 0)) return s;
64
64
  return r > 0 ? -2 : -1;
65
65
  }
66
- function st(n, e = 0) {
66
+ function tt(n, e = 0) {
67
67
  let r = e, s = "";
68
68
  for (let t of n) if (t === " ") {
69
69
  let i = 4 - r % 4;
@@ -71,13 +71,13 @@ function st(n, e = 0) {
71
71
  } else s += t, r++;
72
72
  return s;
73
73
  }
74
- function ne(n, e, r, s, t) {
74
+ function se(n, e, r, s, t) {
75
75
  let i = e.href, l = e.title || null, o = n[1].replace(t.other.outputLinkReplace, "$1");
76
76
  s.state.inLink = !0;
77
77
  let a = { type: n[0].charAt(0) === "!" ? "image" : "link", raw: r, href: i, title: l, text: o, tokens: s.inlineTokens(o) };
78
78
  return s.state.inLink = !1, a;
79
79
  }
80
- function lt(n, e, r) {
80
+ function rt(n, e, r) {
81
81
  let s = n.match(r.other.indentCodeCompensation);
82
82
  if (s === null) return e;
83
83
  let t = s[1];
@@ -90,7 +90,7 @@ function lt(n, e, r) {
90
90
  }).join(`
91
91
  `);
92
92
  }
93
- var q = class {
93
+ var B = class {
94
94
  options;
95
95
  rules;
96
96
  lexer;
@@ -105,14 +105,14 @@ var q = class {
105
105
  let e = this.rules.block.code.exec(n);
106
106
  if (e) {
107
107
  let r = e[0].replace(this.rules.other.codeRemoveIndent, "");
108
- return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? r : A(r, `
108
+ return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? r : _(r, `
109
109
  `) };
110
110
  }
111
111
  }
112
112
  fences(n) {
113
113
  let e = this.rules.block.fences.exec(n);
114
114
  if (e) {
115
- let r = e[0], s = lt(r, e[3] || "", this.rules);
115
+ let r = e[0], s = rt(r, e[3] || "", this.rules);
116
116
  return { type: "code", raw: r, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: s };
117
117
  }
118
118
  }
@@ -121,7 +121,7 @@ var q = class {
121
121
  if (e) {
122
122
  let r = e[2].trim();
123
123
  if (this.rules.other.endingHash.test(r)) {
124
- let s = A(r, "#");
124
+ let s = _(r, "#");
125
125
  (this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (r = s.trim());
126
126
  }
127
127
  return { type: "heading", raw: e[0], depth: e[1].length, text: r, tokens: this.lexer.inline(r) };
@@ -129,13 +129,13 @@ var q = class {
129
129
  }
130
130
  hr(n) {
131
131
  let e = this.rules.block.hr.exec(n);
132
- if (e) return { type: "hr", raw: A(e[0], `
132
+ if (e) return { type: "hr", raw: _(e[0], `
133
133
  `) };
134
134
  }
135
135
  blockquote(n) {
136
136
  let e = this.rules.block.blockquote.exec(n);
137
137
  if (e) {
138
- let r = A(e[0], `
138
+ let r = _(e[0], `
139
139
  `).split(`
140
140
  `), s = "", t = "", i = [];
141
141
  for (; r.length > 0; ) {
@@ -182,25 +182,25 @@ ${c}` : c;
182
182
  let a = !1, h = "", c = "";
183
183
  if (!(e = i.exec(n)) || this.rules.block.hr.test(n)) break;
184
184
  h = e[0], n = n.substring(h.length);
185
- let g = st(e[2].split(`
185
+ let g = tt(e[2].split(`
186
186
  `, 1)[0], e[1].length), u = n.split(`
187
187
  `, 1)[0], d = !g.trim(), f = 0;
188
188
  if (this.options.pedantic ? (f = 2, c = g.trimStart()) : d ? f = e[1].length + 1 : (f = g.search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = g.slice(f), f += e[1].length), d && this.rules.other.blankLine.test(u) && (h += u + `
189
189
  `, n = n.substring(u.length + 1), a = !0), !a) {
190
- let y = this.rules.other.nextBulletRegex(f), U = this.rules.other.hrRegex(f), J = this.rules.other.fencesBeginRegex(f), K = this.rules.other.headingBeginRegex(f), de = this.rules.other.htmlBeginRegex(f), xe = this.rules.other.blockquoteBeginRegex(f);
190
+ let y = this.rules.other.nextBulletRegex(f), J = this.rules.other.hrRegex(f), K = this.rules.other.fencesBeginRegex(f), V = this.rules.other.headingBeginRegex(f), fe = this.rules.other.htmlBeginRegex(f), de = this.rules.other.blockquoteBeginRegex(f);
191
191
  for (; n; ) {
192
- let E = n.split(`
193
- `, 1)[0], T;
194
- if (u = E, this.options.pedantic ? (u = u.replace(this.rules.other.listReplaceNesting, " "), T = u) : T = u.replace(this.rules.other.tabCharGlobal, " "), J.test(u) || K.test(u) || de.test(u) || xe.test(u) || y.test(u) || U.test(u)) break;
195
- if (T.search(this.rules.other.nonSpaceChar) >= f || !u.trim()) c += `
196
- ` + T.slice(f);
192
+ let Z = n.split(`
193
+ `, 1)[0], z;
194
+ if (u = Z, this.options.pedantic ? (u = u.replace(this.rules.other.listReplaceNesting, " "), z = u) : z = u.replace(this.rules.other.tabCharGlobal, " "), K.test(u) || V.test(u) || fe.test(u) || de.test(u) || y.test(u) || J.test(u)) break;
195
+ if (z.search(this.rules.other.nonSpaceChar) >= f || !u.trim()) c += `
196
+ ` + z.slice(f);
197
197
  else {
198
- if (d || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || J.test(g) || K.test(g) || U.test(g)) break;
198
+ if (d || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || K.test(g) || V.test(g) || J.test(g)) break;
199
199
  c += `
200
200
  ` + u;
201
201
  }
202
- d = !u.trim(), h += E + `
203
- `, n = n.substring(E.length + 1), g = T.slice(f);
202
+ d = !u.trim(), h += Z + `
203
+ `, n = n.substring(Z.length + 1), g = z.slice(f);
204
204
  }
205
205
  }
206
206
  t.loose || (l ? t.loose = !0 : this.rules.other.doubleBlankLine.test(h) && (l = !0)), t.items.push({ type: "list_item", raw: h, task: !!this.options.gfm && this.rules.other.listIsTask.test(c), loose: !1, text: c, tokens: [] }), t.raw += h;
@@ -250,18 +250,21 @@ ${c}` : c;
250
250
  table(n) {
251
251
  let e = this.rules.block.table.exec(n);
252
252
  if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
253
- let r = re(e[1]), s = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), t = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
253
+ let r = ne(e[1]), s = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), t = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
254
254
  `) : [], i = { type: "table", raw: e[0], header: [], align: [], rows: [] };
255
255
  if (r.length === s.length) {
256
256
  for (let l of s) this.rules.other.tableAlignRight.test(l) ? i.align.push("right") : this.rules.other.tableAlignCenter.test(l) ? i.align.push("center") : this.rules.other.tableAlignLeft.test(l) ? i.align.push("left") : i.align.push(null);
257
257
  for (let l = 0; l < r.length; l++) i.header.push({ text: r[l], tokens: this.lexer.inline(r[l]), header: !0, align: i.align[l] });
258
- for (let l of t) i.rows.push(re(l, i.header.length).map((o, a) => ({ text: o, tokens: this.lexer.inline(o), header: !1, align: i.align[a] })));
258
+ for (let l of t) i.rows.push(ne(l, i.header.length).map((o, a) => ({ text: o, tokens: this.lexer.inline(o), header: !1, align: i.align[a] })));
259
259
  return i;
260
260
  }
261
261
  }
262
262
  lheading(n) {
263
263
  let e = this.rules.block.lheading.exec(n);
264
- if (e) return { type: "heading", raw: e[0], depth: e[2].charAt(0) === "=" ? 1 : 2, text: e[1], tokens: this.lexer.inline(e[1]) };
264
+ if (e) {
265
+ let r = e[1].trim();
266
+ return { type: "heading", raw: e[0], depth: e[2].charAt(0) === "=" ? 1 : 2, text: r, tokens: this.lexer.inline(r) };
267
+ }
265
268
  }
266
269
  paragraph(n) {
267
270
  let e = this.rules.block.paragraph.exec(n);
@@ -289,10 +292,10 @@ ${c}` : c;
289
292
  let r = e[2].trim();
290
293
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
291
294
  if (!this.rules.other.endAngleBracket.test(r)) return;
292
- let i = A(r.slice(0, -1), "\\");
295
+ let i = _(r.slice(0, -1), "\\");
293
296
  if ((r.length - i.length) % 2 === 0) return;
294
297
  } else {
295
- let i = nt(e[2], "()");
298
+ let i = et(e[2], "()");
296
299
  if (i === -2) return;
297
300
  if (i > -1) {
298
301
  let l = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + i;
@@ -304,7 +307,7 @@ ${c}` : c;
304
307
  let i = this.rules.other.pedanticHrefTitle.exec(s);
305
308
  i && (s = i[1], t = i[3]);
306
309
  } else t = e[3] ? e[3].slice(1, -1) : "";
307
- return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? s = s.slice(1) : s = s.slice(1, -1)), ne(e, { href: s && s.replace(this.rules.inline.anyPunctuation, "$1"), title: t && t.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
310
+ return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? s = s.slice(1) : s = s.slice(1, -1)), se(e, { href: s && s.replace(this.rules.inline.anyPunctuation, "$1"), title: t && t.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
308
311
  }
309
312
  }
310
313
  reflink(n, e) {
@@ -315,12 +318,12 @@ ${c}` : c;
315
318
  let i = r[0].charAt(0);
316
319
  return { type: "text", raw: i, text: i };
317
320
  }
318
- return ne(r, t, r[0], this.lexer, this.rules);
321
+ return se(r, t, r[0], this.lexer, this.rules);
319
322
  }
320
323
  }
321
324
  emStrong(n, e, r = "") {
322
325
  let s = this.rules.inline.emStrongLDelim.exec(n);
323
- if (!(!s || s[3] && r.match(this.rules.other.unicodeAlphaNumeric)) && (!(s[1] || s[2]) || !r || this.rules.inline.punctuation.exec(r))) {
326
+ if (!(!s || !s[1] && !s[2] && !s[3] && !s[4] || s[4] && r.match(this.rules.other.unicodeAlphaNumeric)) && (!(s[1] || s[3]) || !r || this.rules.inline.punctuation.exec(r))) {
324
327
  let t = [...s[0]].length - 1, i, l, o = t, a = 0, h = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
325
328
  for (h.lastIndex = 0, e = e.slice(-1 * n.length + t); (s = h.exec(e)) != null; ) {
326
329
  if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i) continue;
@@ -400,25 +403,25 @@ ${c}` : c;
400
403
  return { type: "text", raw: e[0], text: e[0], escaped: r };
401
404
  }
402
405
  }
403
- }, b = class D {
406
+ }, b = class M {
404
407
  tokens;
405
408
  options;
406
409
  state;
407
410
  inlineQueue;
408
411
  tokenizer;
409
412
  constructor(e) {
410
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || R, this.options.tokenizer = this.options.tokenizer || new q(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
411
- let r = { other: x, block: I.normal, inline: z.normal };
412
- this.options.pedantic ? (r.block = I.pedantic, r.inline = z.pedantic) : this.options.gfm && (r.block = I.gfm, this.options.breaks ? r.inline = z.breaks : r.inline = z.gfm), this.tokenizer.rules = r;
413
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || R, this.options.tokenizer = this.options.tokenizer || new B(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
414
+ let r = { other: x, block: L.normal, inline: A.normal };
415
+ this.options.pedantic ? (r.block = L.pedantic, r.inline = A.pedantic) : this.options.gfm && (r.block = L.gfm, this.options.breaks ? r.inline = A.breaks : r.inline = A.gfm), this.tokenizer.rules = r;
413
416
  }
414
417
  static get rules() {
415
- return { block: I, inline: z };
418
+ return { block: L, inline: A };
416
419
  }
417
420
  static lex(e, r) {
418
- return new D(r).lex(e);
421
+ return new M(r).lex(e);
419
422
  }
420
423
  static lexInline(e, r) {
421
- return new D(r).inlineTokens(e);
424
+ return new M(r).inlineTokens(e);
422
425
  }
423
426
  lex(e) {
424
427
  e = e.replace(x.carriageReturn, `
@@ -430,7 +433,7 @@ ${c}` : c;
430
433
  return this.inlineQueue = [], this.tokens;
431
434
  }
432
435
  blockTokens(e, r = [], s = !1) {
433
- for (this.options.pedantic && (e = e.replace(x.tabCharGlobal, " ").replace(x.spaceLine, "")); e; ) {
436
+ for (this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(x.tabCharGlobal, " ").replace(x.spaceLine, "")); e; ) {
434
437
  let t;
435
438
  if (this.options.extensions?.block?.some((l) => (t = l.call({ lexer: this }, e, r)) ? (e = e.substring(t.raw.length), r.push(t), !0) : !1)) continue;
436
439
  if (t = this.tokenizer.space(e)) {
@@ -528,6 +531,7 @@ ${c}` : c;
528
531
  return this.inlineQueue.push({ src: e, tokens: r }), r;
529
532
  }
530
533
  inlineTokens(e, r = []) {
534
+ this.tokenizer.lexer = this;
531
535
  let s = e, t = null;
532
536
  if (this.tokens.links) {
533
537
  let a = Object.keys(this.tokens.links);
@@ -607,7 +611,7 @@ ${c}` : c;
607
611
  }
608
612
  return r;
609
613
  }
610
- }, B = class {
614
+ }, C = class {
611
615
  options;
612
616
  parser;
613
617
  constructor(n) {
@@ -707,7 +711,7 @@ ${n}</tr>
707
711
  return `<del>${this.parser.parseInline(n)}</del>`;
708
712
  }
709
713
  link({ href: n, title: e, tokens: r }) {
710
- let s = this.parser.parseInline(r), t = te(n);
714
+ let s = this.parser.parseInline(r), t = re(n);
711
715
  if (t === null) return s;
712
716
  n = t;
713
717
  let i = '<a href="' + n + '"';
@@ -715,7 +719,7 @@ ${n}</tr>
715
719
  }
716
720
  image({ href: n, title: e, text: r, tokens: s }) {
717
721
  s && (r = this.parser.parseInline(s, this.parser.textRenderer));
718
- let t = te(n);
722
+ let t = re(n);
719
723
  if (t === null) return m(r);
720
724
  n = t;
721
725
  let i = `<img src="${n}" alt="${m(r)}"`;
@@ -724,7 +728,7 @@ ${n}</tr>
724
728
  text(n) {
725
729
  return "tokens" in n && n.tokens ? this.parser.parseInline(n.tokens) : "escaped" in n && n.escaped ? n.text : m(n.text);
726
730
  }
727
- }, F = class {
731
+ }, U = class {
728
732
  strong({ text: n }) {
729
733
  return n;
730
734
  }
@@ -755,20 +759,21 @@ ${n}</tr>
755
759
  checkbox({ raw: n }) {
756
760
  return n;
757
761
  }
758
- }, w = class M {
762
+ }, w = class Q {
759
763
  options;
760
764
  renderer;
761
765
  textRenderer;
762
766
  constructor(e) {
763
- this.options = e || R, this.options.renderer = this.options.renderer || new B(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new F();
767
+ this.options = e || R, 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 U();
764
768
  }
765
769
  static parse(e, r) {
766
- return new M(r).parse(e);
770
+ return new Q(r).parse(e);
767
771
  }
768
772
  static parseInline(e, r) {
769
- return new M(r).parseInline(e);
773
+ return new Q(r).parseInline(e);
770
774
  }
771
775
  parse(e) {
776
+ this.renderer.parser = this;
772
777
  let r = "";
773
778
  for (let s = 0; s < e.length; s++) {
774
779
  let t = e[s];
@@ -839,6 +844,7 @@ ${n}</tr>
839
844
  return r;
840
845
  }
841
846
  parseInline(e, r = this.renderer) {
847
+ this.renderer.parser = this;
842
848
  let s = "";
843
849
  for (let t = 0; t < e.length; t++) {
844
850
  let i = e[t];
@@ -904,7 +910,7 @@ ${n}</tr>
904
910
  }
905
911
  return s;
906
912
  }
907
- }, _ = class {
913
+ }, P = class {
908
914
  options;
909
915
  block;
910
916
  constructor(n) {
@@ -930,17 +936,17 @@ ${n}</tr>
930
936
  provideParser() {
931
937
  return this.block ? w.parse : w.parseInline;
932
938
  }
933
- }, it = class {
934
- defaults = Q();
939
+ }, nt = class {
940
+ defaults = H();
935
941
  options = this.setOptions;
936
942
  parse = this.parseMarkdown(!0);
937
943
  parseInline = this.parseMarkdown(!1);
938
944
  Parser = w;
939
- Renderer = B;
940
- TextRenderer = F;
945
+ Renderer = C;
946
+ TextRenderer = U;
941
947
  Lexer = b;
942
- Tokenizer = q;
943
- Hooks = _;
948
+ Tokenizer = B;
949
+ Hooks = P;
944
950
  constructor(...n) {
945
951
  this.use(...n);
946
952
  }
@@ -988,7 +994,7 @@ ${n}</tr>
988
994
  }
989
995
  "childTokens" in t && t.childTokens && (e.childTokens[t.name] = t.childTokens);
990
996
  }), s.extensions = e), r.renderer) {
991
- let t = this.defaults.renderer || new B(this.defaults);
997
+ let t = this.defaults.renderer || new C(this.defaults);
992
998
  for (let i in r.renderer) {
993
999
  if (!(i in t)) throw new Error(`renderer '${i}' does not exist`);
994
1000
  if (["options", "parser"].includes(i)) continue;
@@ -1001,7 +1007,7 @@ ${n}</tr>
1001
1007
  s.renderer = t;
1002
1008
  }
1003
1009
  if (r.tokenizer) {
1004
- let t = this.defaults.tokenizer || new q(this.defaults);
1010
+ let t = this.defaults.tokenizer || new B(this.defaults);
1005
1011
  for (let i in r.tokenizer) {
1006
1012
  if (!(i in t)) throw new Error(`tokenizer '${i}' does not exist`);
1007
1013
  if (["options", "rules", "lexer"].includes(i)) continue;
@@ -1014,13 +1020,13 @@ ${n}</tr>
1014
1020
  s.tokenizer = t;
1015
1021
  }
1016
1022
  if (r.hooks) {
1017
- let t = this.defaults.hooks || new _();
1023
+ let t = this.defaults.hooks || new P();
1018
1024
  for (let i in r.hooks) {
1019
1025
  if (!(i in t)) throw new Error(`hook '${i}' does not exist`);
1020
1026
  if (["options", "block"].includes(i)) continue;
1021
1027
  let l = i, o = r.hooks[l], a = t[l];
1022
- _.passThroughHooks.has(i) ? t[l] = (h) => {
1023
- if (this.defaults.async && _.passThroughHooksRespectAsync.has(i)) return (async () => {
1028
+ P.passThroughHooks.has(i) ? t[l] = (h) => {
1029
+ if (this.defaults.async && P.passThroughHooksRespectAsync.has(i)) return (async () => {
1024
1030
  let g = await o.call(t, h);
1025
1031
  return a.call(t, g);
1026
1032
  })();
@@ -1090,17 +1096,17 @@ Please report this to https://github.com/markedjs/marked.`, n) {
1090
1096
  throw r;
1091
1097
  };
1092
1098
  }
1093
- }, S = new it();
1099
+ }, S = new nt();
1094
1100
  function k(n, e) {
1095
1101
  return S.parse(n, e);
1096
1102
  }
1097
1103
  k.options = k.setOptions = function(n) {
1098
- return S.setOptions(n), k.defaults = S.defaults, se(k.defaults), k;
1104
+ return S.setOptions(n), k.defaults = S.defaults, le(k.defaults), k;
1099
1105
  };
1100
- k.getDefaults = Q;
1106
+ k.getDefaults = H;
1101
1107
  k.defaults = R;
1102
1108
  k.use = function(...n) {
1103
- return S.use(...n), k.defaults = S.defaults, se(k.defaults), k;
1109
+ return S.use(...n), k.defaults = S.defaults, le(k.defaults), k;
1104
1110
  };
1105
1111
  k.walkTokens = function(n, e) {
1106
1112
  return S.walkTokens(n, e);
@@ -1108,12 +1114,12 @@ k.walkTokens = function(n, e) {
1108
1114
  k.parseInline = S.parseInline;
1109
1115
  k.Parser = w;
1110
1116
  k.parser = w.parse;
1111
- k.Renderer = B;
1112
- k.TextRenderer = F;
1117
+ k.Renderer = C;
1118
+ k.TextRenderer = U;
1113
1119
  k.Lexer = b;
1114
1120
  k.lexer = b.lex;
1115
- k.Tokenizer = q;
1116
- k.Hooks = _;
1121
+ k.Tokenizer = B;
1122
+ k.Hooks = P;
1117
1123
  k.parse = k;
1118
1124
  k.options;
1119
1125
  k.setOptions;
@@ -1136,9 +1142,9 @@ k.use({
1136
1142
  }
1137
1143
  }
1138
1144
  });
1139
- function at(n) {
1145
+ function st(n) {
1140
1146
  return n == null ? "" : k.parse(typeof n == "string" ? n : n.value, { async: !1 });
1141
1147
  }
1142
1148
  export {
1143
- at as c
1149
+ st as c
1144
1150
  };