@arcgis/coding-components 5.1.0-next.13 → 5.1.0-next.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{JGASZMML.js → BVH2QXVK.js} +1 -1
- package/dist/cdn/DZ6A65Y5.js +60 -0
- package/dist/cdn/{VD5UOV5M.js → F75C3HE6.js} +1 -1
- package/dist/cdn/{CEX6Z6XG.js → FWVG6H2C.js} +1 -1
- package/dist/cdn/HPVGJHBT.js +4 -0
- package/dist/cdn/{YBTWB6XC.js → HZ5MCXUU.js} +1 -1
- package/dist/cdn/{V2SLLOQ5.js → JRXT6REI.js} +1 -1
- package/dist/cdn/{5XIHWLQI.js → KTJPAA4C.js} +1 -1
- package/dist/cdn/{JQTEKTO5.js → OSU57IUK.js} +1 -1
- package/dist/cdn/{S5RUOHYM.js → SXHJ77MK.js} +1 -1
- package/dist/cdn/{2TB2LHRA.js → THYQLG3F.js} +1 -1
- package/dist/cdn/{44MLHT3A.js → XTNBVMHY.js} +1 -1
- package/dist/cdn/{H75CMJQP.js → YLUPZ4JE.js} +1 -1
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/language-defaults-base.js +9 -9
- package/dist/chunks/markdown.js +409 -388
- package/dist/components/arcgis-arcade-coding-assistant/customElement.js +352 -302
- package/dist/components/arcgis-arcade-editor/customElement.js +11 -11
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +1 -1
- package/dist/utils/arcade-assistant/types.d.ts +2 -0
- package/dist/utils/arcade-executor.d.ts +1 -1
- package/package.json +5 -5
- package/dist/cdn/2ORJ3A7K.js +0 -4
- package/dist/cdn/AQEEMLO5.js +0 -60
- /package/dist/cdn/{HVHTW7TF.js → 7LS3R4TH.js} +0 -0
package/dist/chunks/markdown.js
CHANGED
|
@@ -1,78 +1,86 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
function
|
|
2
|
+
function Q() {
|
|
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 =
|
|
6
|
-
function
|
|
7
|
-
R =
|
|
5
|
+
var R = Q();
|
|
6
|
+
function se(n) {
|
|
7
|
+
R = n;
|
|
8
8
|
}
|
|
9
|
-
var
|
|
10
|
-
function p(
|
|
11
|
-
let r = typeof
|
|
9
|
+
var $ = { exec: () => null };
|
|
10
|
+
function p(n, e = "") {
|
|
11
|
+
let r = typeof n == "string" ? n : n.source, s = { replace: (t, i) => {
|
|
12
12
|
let l = typeof i == "string" ? i : i.source;
|
|
13
|
-
return l = l.replace(x.caret, "$1"), r = r.replace(t, l),
|
|
13
|
+
return l = l.replace(x.caret, "$1"), r = r.replace(t, l), s;
|
|
14
14
|
}, getRegex: () => new RegExp(r, e) };
|
|
15
|
-
return
|
|
15
|
+
return s;
|
|
16
16
|
}
|
|
17
|
-
var
|
|
17
|
+
var be = (() => {
|
|
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,
|
|
24
|
-
]`).replace("lheading", ie).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() },
|
|
25
|
-
function y(
|
|
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, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, 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)", Fe = p(Xe, "gu").replace(/notPunctSpace/g, De).replace(/punctSpace/g, Ze).replace(/punct/g, pe).getRegex(), We = 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]*)?)(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]/, F = { _backpedal: $, anyPunctuation: We, 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 = { ...F, link: p(/^!?\[(label)\]\((.*?)\)/).replace("label", L).getRegex(), reflink: p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", L).getRegex() }, Z = { ...F, emStrongRDelimAst: Oe, emStrongLDelim: He, delLDelim: Ge, delRDelim: Fe, 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: F, gfm: Z, breaks: tt, pedantic: et }, rt = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, ee = (n) => rt[n];
|
|
25
|
+
function y(n, e) {
|
|
26
26
|
if (e) {
|
|
27
|
-
if (x.escapeTest.test(
|
|
28
|
-
} else if (x.escapeTestNoEncode.test(
|
|
29
|
-
return
|
|
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);
|
|
29
|
+
return n;
|
|
30
30
|
}
|
|
31
|
-
function te(
|
|
31
|
+
function te(n) {
|
|
32
32
|
try {
|
|
33
|
-
|
|
33
|
+
n = encodeURI(n).replace(x.percentDecode, "%");
|
|
34
34
|
} catch {
|
|
35
35
|
return null;
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return n;
|
|
38
38
|
}
|
|
39
|
-
function re(
|
|
40
|
-
let r =
|
|
39
|
+
function re(n, e) {
|
|
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;
|
|
43
43
|
return a ? "|" : " |";
|
|
44
|
-
}),
|
|
45
|
-
if (
|
|
46
|
-
else for (;
|
|
47
|
-
for (; t <
|
|
48
|
-
return
|
|
44
|
+
}), s = r.split(x.splitPipe), t = 0;
|
|
45
|
+
if (s[0].trim() || s.shift(), s.length > 0 && !s.at(-1)?.trim() && s.pop(), e) if (s.length > e) s.splice(e);
|
|
46
|
+
else for (; s.length < e; ) s.push("");
|
|
47
|
+
for (; t < s.length; t++) s[t] = s[t].trim().replace(x.slashPipe, "|");
|
|
48
|
+
return s;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
let
|
|
52
|
-
if (
|
|
50
|
+
function A(n, e, r) {
|
|
51
|
+
let s = n.length;
|
|
52
|
+
if (s === 0) return "";
|
|
53
53
|
let t = 0;
|
|
54
|
-
for (; t <
|
|
54
|
+
for (; t < s && n.charAt(s - t - 1) === e; )
|
|
55
55
|
t++;
|
|
56
|
-
return
|
|
56
|
+
return n.slice(0, s - t);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
if (
|
|
58
|
+
function nt(n, e) {
|
|
59
|
+
if (n.indexOf(e[1]) === -1) return -1;
|
|
60
60
|
let r = 0;
|
|
61
|
-
for (let
|
|
62
|
-
else if (s
|
|
63
|
-
else if (s
|
|
61
|
+
for (let s = 0; s < n.length; s++) if (n[s] === "\\") s++;
|
|
62
|
+
else if (n[s] === e[0]) r++;
|
|
63
|
+
else if (n[s] === e[1] && (r--, r < 0)) return s;
|
|
64
64
|
return r > 0 ? -2 : -1;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
let
|
|
68
|
-
n
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
function st(n, e = 0) {
|
|
67
|
+
let r = e, s = "";
|
|
68
|
+
for (let t of n) if (t === " ") {
|
|
69
|
+
let i = 4 - r % 4;
|
|
70
|
+
s += " ".repeat(i), r += i;
|
|
71
|
+
} else s += t, r++;
|
|
72
|
+
return s;
|
|
71
73
|
}
|
|
72
|
-
function
|
|
73
|
-
let
|
|
74
|
-
|
|
75
|
-
let
|
|
74
|
+
function ne(n, e, r, s, t) {
|
|
75
|
+
let i = e.href, l = e.title || null, o = n[1].replace(t.other.outputLinkReplace, "$1");
|
|
76
|
+
s.state.inLink = !0;
|
|
77
|
+
let a = { type: n[0].charAt(0) === "!" ? "image" : "link", raw: r, href: i, title: l, text: o, tokens: s.inlineTokens(o) };
|
|
78
|
+
return s.state.inLink = !1, a;
|
|
79
|
+
}
|
|
80
|
+
function lt(n, e, r) {
|
|
81
|
+
let s = n.match(r.other.indentCodeCompensation);
|
|
82
|
+
if (s === null) return e;
|
|
83
|
+
let t = s[1];
|
|
76
84
|
return e.split(`
|
|
77
85
|
`).map((i) => {
|
|
78
86
|
let l = i.match(r.other.beginningSpace);
|
|
@@ -82,54 +90,54 @@ function Ke(s, e, r) {
|
|
|
82
90
|
}).join(`
|
|
83
91
|
`);
|
|
84
92
|
}
|
|
85
|
-
var
|
|
93
|
+
var q = class {
|
|
86
94
|
options;
|
|
87
95
|
rules;
|
|
88
96
|
lexer;
|
|
89
|
-
constructor(
|
|
90
|
-
this.options =
|
|
97
|
+
constructor(n) {
|
|
98
|
+
this.options = n || R;
|
|
91
99
|
}
|
|
92
|
-
space(
|
|
93
|
-
let e = this.rules.block.newline.exec(
|
|
100
|
+
space(n) {
|
|
101
|
+
let e = this.rules.block.newline.exec(n);
|
|
94
102
|
if (e && e[0].length > 0) return { type: "space", raw: e[0] };
|
|
95
103
|
}
|
|
96
|
-
code(
|
|
97
|
-
let e = this.rules.block.code.exec(
|
|
104
|
+
code(n) {
|
|
105
|
+
let e = this.rules.block.code.exec(n);
|
|
98
106
|
if (e) {
|
|
99
107
|
let r = e[0].replace(this.rules.other.codeRemoveIndent, "");
|
|
100
|
-
return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? r :
|
|
108
|
+
return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? r : A(r, `
|
|
101
109
|
`) };
|
|
102
110
|
}
|
|
103
111
|
}
|
|
104
|
-
fences(
|
|
105
|
-
let e = this.rules.block.fences.exec(
|
|
112
|
+
fences(n) {
|
|
113
|
+
let e = this.rules.block.fences.exec(n);
|
|
106
114
|
if (e) {
|
|
107
|
-
let r = e[0],
|
|
108
|
-
return { type: "code", raw: r, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text:
|
|
115
|
+
let r = e[0], s = lt(r, e[3] || "", this.rules);
|
|
116
|
+
return { type: "code", raw: r, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: s };
|
|
109
117
|
}
|
|
110
118
|
}
|
|
111
|
-
heading(
|
|
112
|
-
let e = this.rules.block.heading.exec(
|
|
119
|
+
heading(n) {
|
|
120
|
+
let e = this.rules.block.heading.exec(n);
|
|
113
121
|
if (e) {
|
|
114
122
|
let r = e[2].trim();
|
|
115
123
|
if (this.rules.other.endingHash.test(r)) {
|
|
116
|
-
let
|
|
117
|
-
(this.options.pedantic || !
|
|
124
|
+
let s = A(r, "#");
|
|
125
|
+
(this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (r = s.trim());
|
|
118
126
|
}
|
|
119
127
|
return { type: "heading", raw: e[0], depth: e[1].length, text: r, tokens: this.lexer.inline(r) };
|
|
120
128
|
}
|
|
121
129
|
}
|
|
122
|
-
hr(
|
|
123
|
-
let e = this.rules.block.hr.exec(
|
|
124
|
-
if (e) return { type: "hr", raw:
|
|
130
|
+
hr(n) {
|
|
131
|
+
let e = this.rules.block.hr.exec(n);
|
|
132
|
+
if (e) return { type: "hr", raw: A(e[0], `
|
|
125
133
|
`) };
|
|
126
134
|
}
|
|
127
|
-
blockquote(
|
|
128
|
-
let e = this.rules.block.blockquote.exec(
|
|
135
|
+
blockquote(n) {
|
|
136
|
+
let e = this.rules.block.blockquote.exec(n);
|
|
129
137
|
if (e) {
|
|
130
|
-
let r =
|
|
138
|
+
let r = A(e[0], `
|
|
131
139
|
`).split(`
|
|
132
|
-
`),
|
|
140
|
+
`), s = "", t = "", i = [];
|
|
133
141
|
for (; r.length > 0; ) {
|
|
134
142
|
let l = !1, o = [], a;
|
|
135
143
|
for (a = 0; a < r.length; a++) if (this.rules.other.blockquoteStart.test(r[a])) o.push(r[a]), l = !0;
|
|
@@ -139,60 +147,60 @@ var C = class {
|
|
|
139
147
|
let h = o.join(`
|
|
140
148
|
`), c = h.replace(this.rules.other.blockquoteSetextReplace, `
|
|
141
149
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
142
|
-
|
|
150
|
+
s = s ? `${s}
|
|
143
151
|
${h}` : h, t = t ? `${t}
|
|
144
152
|
${c}` : c;
|
|
145
|
-
let
|
|
146
|
-
if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top =
|
|
153
|
+
let g = this.lexer.state.top;
|
|
154
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = g, r.length === 0) break;
|
|
147
155
|
let u = i.at(-1);
|
|
148
156
|
if (u?.type === "code") break;
|
|
149
157
|
if (u?.type === "blockquote") {
|
|
150
158
|
let d = u, f = d.raw + `
|
|
151
159
|
` + r.join(`
|
|
152
|
-
`),
|
|
153
|
-
i[i.length - 1] =
|
|
160
|
+
`), m = this.blockquote(f);
|
|
161
|
+
i[i.length - 1] = m, s = s.substring(0, s.length - d.raw.length) + m.raw, t = t.substring(0, t.length - d.text.length) + m.text;
|
|
154
162
|
break;
|
|
155
163
|
} else if (u?.type === "list") {
|
|
156
164
|
let d = u, f = d.raw + `
|
|
157
165
|
` + r.join(`
|
|
158
|
-
`),
|
|
159
|
-
i[i.length - 1] =
|
|
166
|
+
`), m = this.list(f);
|
|
167
|
+
i[i.length - 1] = m, s = s.substring(0, s.length - u.raw.length) + m.raw, t = t.substring(0, t.length - d.raw.length) + m.raw, r = f.substring(i.at(-1).raw.length).split(`
|
|
160
168
|
`);
|
|
161
169
|
continue;
|
|
162
170
|
}
|
|
163
171
|
}
|
|
164
|
-
return { type: "blockquote", raw:
|
|
172
|
+
return { type: "blockquote", raw: s, tokens: i, text: t };
|
|
165
173
|
}
|
|
166
174
|
}
|
|
167
|
-
list(
|
|
168
|
-
let e = this.rules.block.list.exec(
|
|
175
|
+
list(n) {
|
|
176
|
+
let e = this.rules.block.list.exec(n);
|
|
169
177
|
if (e) {
|
|
170
|
-
let r = e[1].trim(),
|
|
171
|
-
r =
|
|
178
|
+
let r = e[1].trim(), s = r.length > 1, t = { type: "list", raw: "", ordered: s, start: s ? +r.slice(0, -1) : "", loose: !1, items: [] };
|
|
179
|
+
r = s ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = s ? r : "[*+-]");
|
|
172
180
|
let i = this.rules.other.listItemRegex(r), l = !1;
|
|
173
|
-
for (;
|
|
181
|
+
for (; n; ) {
|
|
174
182
|
let a = !1, h = "", c = "";
|
|
175
|
-
if (!(e = i.exec(
|
|
176
|
-
h = e[0],
|
|
177
|
-
let
|
|
178
|
-
`, 1)[0]
|
|
179
|
-
`, 1)[0], d = !
|
|
180
|
-
if (this.options.pedantic ? (f = 2, c =
|
|
181
|
-
`,
|
|
182
|
-
let
|
|
183
|
-
for (;
|
|
184
|
-
let E =
|
|
185
|
-
`, 1)[0],
|
|
186
|
-
if (u = E, this.options.pedantic ? (u = u.replace(this.rules.other.listReplaceNesting, " "),
|
|
187
|
-
if (
|
|
188
|
-
` +
|
|
183
|
+
if (!(e = i.exec(n)) || this.rules.block.hr.test(n)) break;
|
|
184
|
+
h = e[0], n = n.substring(h.length);
|
|
185
|
+
let g = st(e[2].split(`
|
|
186
|
+
`, 1)[0], e[1].length), u = n.split(`
|
|
187
|
+
`, 1)[0], d = !g.trim(), f = 0;
|
|
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
|
+
`, n = n.substring(u.length + 1), a = !0), !a) {
|
|
190
|
+
let m = 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);
|
|
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) || m.test(u) || U.test(u)) break;
|
|
195
|
+
if (T.search(this.rules.other.nonSpaceChar) >= f || !u.trim()) c += `
|
|
196
|
+
` + T.slice(f);
|
|
189
197
|
else {
|
|
190
|
-
if (d ||
|
|
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;
|
|
191
199
|
c += `
|
|
192
200
|
` + u;
|
|
193
201
|
}
|
|
194
|
-
|
|
195
|
-
`,
|
|
202
|
+
d = !u.trim(), h += E + `
|
|
203
|
+
`, n = n.substring(E.length + 1), g = T.slice(f);
|
|
196
204
|
}
|
|
197
205
|
}
|
|
198
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;
|
|
@@ -217,7 +225,7 @@ ${c}` : c;
|
|
|
217
225
|
}
|
|
218
226
|
}
|
|
219
227
|
if (!t.loose) {
|
|
220
|
-
let h = a.tokens.filter((
|
|
228
|
+
let h = a.tokens.filter((g) => g.type === "space"), c = h.length > 0 && h.some((g) => this.rules.other.anyLine.test(g.raw));
|
|
221
229
|
t.loose = c;
|
|
222
230
|
}
|
|
223
231
|
}
|
|
@@ -228,187 +236,200 @@ ${c}` : c;
|
|
|
228
236
|
return t;
|
|
229
237
|
}
|
|
230
238
|
}
|
|
231
|
-
html(
|
|
232
|
-
let e = this.rules.block.html.exec(
|
|
239
|
+
html(n) {
|
|
240
|
+
let e = this.rules.block.html.exec(n);
|
|
233
241
|
if (e) return { type: "html", block: !0, raw: e[0], pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: e[0] };
|
|
234
242
|
}
|
|
235
|
-
def(
|
|
236
|
-
let e = this.rules.block.def.exec(
|
|
243
|
+
def(n) {
|
|
244
|
+
let e = this.rules.block.def.exec(n);
|
|
237
245
|
if (e) {
|
|
238
|
-
let r = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "),
|
|
239
|
-
return { type: "def", tag: r, raw: e[0], href:
|
|
246
|
+
let r = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), s = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", t = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
|
|
247
|
+
return { type: "def", tag: r, raw: e[0], href: s, title: t };
|
|
240
248
|
}
|
|
241
249
|
}
|
|
242
|
-
table(
|
|
243
|
-
let e = this.rules.block.table.exec(
|
|
250
|
+
table(n) {
|
|
251
|
+
let e = this.rules.block.table.exec(n);
|
|
244
252
|
if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
|
|
245
|
-
let r = re(e[1]),
|
|
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(`
|
|
246
254
|
`) : [], i = { type: "table", raw: e[0], header: [], align: [], rows: [] };
|
|
247
|
-
if (r.length ===
|
|
248
|
-
for (let l of
|
|
255
|
+
if (r.length === s.length) {
|
|
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);
|
|
249
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] });
|
|
250
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] })));
|
|
251
259
|
return i;
|
|
252
260
|
}
|
|
253
261
|
}
|
|
254
|
-
lheading(
|
|
255
|
-
let e = this.rules.block.lheading.exec(
|
|
262
|
+
lheading(n) {
|
|
263
|
+
let e = this.rules.block.lheading.exec(n);
|
|
256
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]) };
|
|
257
265
|
}
|
|
258
|
-
paragraph(
|
|
259
|
-
let e = this.rules.block.paragraph.exec(
|
|
266
|
+
paragraph(n) {
|
|
267
|
+
let e = this.rules.block.paragraph.exec(n);
|
|
260
268
|
if (e) {
|
|
261
269
|
let r = e[1].charAt(e[1].length - 1) === `
|
|
262
270
|
` ? e[1].slice(0, -1) : e[1];
|
|
263
271
|
return { type: "paragraph", raw: e[0], text: r, tokens: this.lexer.inline(r) };
|
|
264
272
|
}
|
|
265
273
|
}
|
|
266
|
-
text(
|
|
267
|
-
let e = this.rules.block.text.exec(
|
|
274
|
+
text(n) {
|
|
275
|
+
let e = this.rules.block.text.exec(n);
|
|
268
276
|
if (e) return { type: "text", raw: e[0], text: e[0], tokens: this.lexer.inline(e[0]) };
|
|
269
277
|
}
|
|
270
|
-
escape(
|
|
271
|
-
let e = this.rules.inline.escape.exec(
|
|
278
|
+
escape(n) {
|
|
279
|
+
let e = this.rules.inline.escape.exec(n);
|
|
272
280
|
if (e) return { type: "escape", raw: e[0], text: e[1] };
|
|
273
281
|
}
|
|
274
|
-
tag(
|
|
275
|
-
let e = this.rules.inline.tag.exec(
|
|
282
|
+
tag(n) {
|
|
283
|
+
let e = this.rules.inline.tag.exec(n);
|
|
276
284
|
if (e) return !this.lexer.state.inLink && this.rules.other.startATag.test(e[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(e[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(e[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(e[0]) && (this.lexer.state.inRawBlock = !1), { type: "html", raw: e[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: !1, text: e[0] };
|
|
277
285
|
}
|
|
278
|
-
link(
|
|
279
|
-
let e = this.rules.inline.link.exec(
|
|
286
|
+
link(n) {
|
|
287
|
+
let e = this.rules.inline.link.exec(n);
|
|
280
288
|
if (e) {
|
|
281
289
|
let r = e[2].trim();
|
|
282
290
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
|
|
283
291
|
if (!this.rules.other.endAngleBracket.test(r)) return;
|
|
284
|
-
let i =
|
|
292
|
+
let i = A(r.slice(0, -1), "\\");
|
|
285
293
|
if ((r.length - i.length) % 2 === 0) return;
|
|
286
294
|
} else {
|
|
287
|
-
let i =
|
|
295
|
+
let i = nt(e[2], "()");
|
|
288
296
|
if (i === -2) return;
|
|
289
297
|
if (i > -1) {
|
|
290
298
|
let l = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + i;
|
|
291
299
|
e[2] = e[2].substring(0, i), e[0] = e[0].substring(0, l).trim(), e[3] = "";
|
|
292
300
|
}
|
|
293
301
|
}
|
|
294
|
-
let
|
|
302
|
+
let s = e[2], t = "";
|
|
295
303
|
if (this.options.pedantic) {
|
|
296
|
-
let i = this.rules.other.pedanticHrefTitle.exec(
|
|
297
|
-
i && (
|
|
304
|
+
let i = this.rules.other.pedanticHrefTitle.exec(s);
|
|
305
|
+
i && (s = i[1], t = i[3]);
|
|
298
306
|
} else t = e[3] ? e[3].slice(1, -1) : "";
|
|
299
|
-
return
|
|
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);
|
|
300
308
|
}
|
|
301
309
|
}
|
|
302
|
-
reflink(
|
|
310
|
+
reflink(n, e) {
|
|
303
311
|
let r;
|
|
304
|
-
if ((r = this.rules.inline.reflink.exec(
|
|
305
|
-
let
|
|
312
|
+
if ((r = this.rules.inline.reflink.exec(n)) || (r = this.rules.inline.nolink.exec(n))) {
|
|
313
|
+
let s = (r[2] || r[1]).replace(this.rules.other.multipleSpaceGlobal, " "), t = e[s.toLowerCase()];
|
|
306
314
|
if (!t) {
|
|
307
315
|
let i = r[0].charAt(0);
|
|
308
316
|
return { type: "text", raw: i, text: i };
|
|
309
317
|
}
|
|
310
|
-
return
|
|
318
|
+
return ne(r, t, r[0], this.lexer, this.rules);
|
|
311
319
|
}
|
|
312
320
|
}
|
|
313
|
-
emStrong(
|
|
314
|
-
let
|
|
315
|
-
if (!(!
|
|
316
|
-
let t = [...
|
|
317
|
-
for (h.lastIndex = 0, e = e.slice(-1 *
|
|
318
|
-
if (i =
|
|
319
|
-
if (l = [...i].length,
|
|
321
|
+
emStrong(n, e, r = "") {
|
|
322
|
+
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))) {
|
|
324
|
+
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
|
+
for (h.lastIndex = 0, e = e.slice(-1 * n.length + t); (s = h.exec(e)) != null; ) {
|
|
326
|
+
if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i) continue;
|
|
327
|
+
if (l = [...i].length, s[3] || s[4]) {
|
|
320
328
|
o += l;
|
|
321
329
|
continue;
|
|
322
|
-
} else if ((
|
|
330
|
+
} else if ((s[5] || s[6]) && t % 3 && !((t + l) % 3)) {
|
|
323
331
|
a += l;
|
|
324
332
|
continue;
|
|
325
333
|
}
|
|
326
334
|
if (o -= l, o > 0) continue;
|
|
327
335
|
l = Math.min(l, l + o + a);
|
|
328
|
-
let c = [...
|
|
336
|
+
let c = [...s[0]][0].length, g = n.slice(0, t + s.index + c + l);
|
|
329
337
|
if (Math.min(t, l) % 2) {
|
|
330
|
-
let d =
|
|
331
|
-
return { type: "em", raw:
|
|
338
|
+
let d = g.slice(1, -1);
|
|
339
|
+
return { type: "em", raw: g, text: d, tokens: this.lexer.inlineTokens(d) };
|
|
332
340
|
}
|
|
333
|
-
let u =
|
|
334
|
-
return { type: "strong", raw:
|
|
341
|
+
let u = g.slice(2, -2);
|
|
342
|
+
return { type: "strong", raw: g, text: u, tokens: this.lexer.inlineTokens(u) };
|
|
335
343
|
}
|
|
336
344
|
}
|
|
337
345
|
}
|
|
338
|
-
codespan(
|
|
339
|
-
let e = this.rules.inline.code.exec(
|
|
346
|
+
codespan(n) {
|
|
347
|
+
let e = this.rules.inline.code.exec(n);
|
|
340
348
|
if (e) {
|
|
341
|
-
let r = e[2].replace(this.rules.other.newLineCharGlobal, " "),
|
|
342
|
-
return
|
|
349
|
+
let r = e[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(r), t = this.rules.other.startingSpaceChar.test(r) && this.rules.other.endingSpaceChar.test(r);
|
|
350
|
+
return s && t && (r = r.substring(1, r.length - 1)), { type: "codespan", raw: e[0], text: r };
|
|
343
351
|
}
|
|
344
352
|
}
|
|
345
|
-
br(
|
|
346
|
-
let e = this.rules.inline.br.exec(
|
|
353
|
+
br(n) {
|
|
354
|
+
let e = this.rules.inline.br.exec(n);
|
|
347
355
|
if (e) return { type: "br", raw: e[0] };
|
|
348
356
|
}
|
|
349
|
-
del(
|
|
350
|
-
let
|
|
351
|
-
if (
|
|
357
|
+
del(n, e, r = "") {
|
|
358
|
+
let s = this.rules.inline.delLDelim.exec(n);
|
|
359
|
+
if (s && (!s[1] || !r || this.rules.inline.punctuation.exec(r))) {
|
|
360
|
+
let t = [...s[0]].length - 1, i, l, o = t, a = this.rules.inline.delRDelim;
|
|
361
|
+
for (a.lastIndex = 0, e = e.slice(-1 * n.length + t); (s = a.exec(e)) != null; ) {
|
|
362
|
+
if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i || (l = [...i].length, l !== t)) continue;
|
|
363
|
+
if (s[3] || s[4]) {
|
|
364
|
+
o += l;
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
if (o -= l, o > 0) continue;
|
|
368
|
+
l = Math.min(l, l + o);
|
|
369
|
+
let h = [...s[0]][0].length, c = n.slice(0, t + s.index + h + l), g = c.slice(t, -t);
|
|
370
|
+
return { type: "del", raw: c, text: g, tokens: this.lexer.inlineTokens(g) };
|
|
371
|
+
}
|
|
372
|
+
}
|
|
352
373
|
}
|
|
353
|
-
autolink(
|
|
354
|
-
let e = this.rules.inline.autolink.exec(
|
|
374
|
+
autolink(n) {
|
|
375
|
+
let e = this.rules.inline.autolink.exec(n);
|
|
355
376
|
if (e) {
|
|
356
|
-
let r,
|
|
357
|
-
return e[2] === "@" ? (r = e[1],
|
|
377
|
+
let r, s;
|
|
378
|
+
return e[2] === "@" ? (r = e[1], s = "mailto:" + r) : (r = e[1], s = r), { type: "link", raw: e[0], text: r, href: s, tokens: [{ type: "text", raw: r, text: r }] };
|
|
358
379
|
}
|
|
359
380
|
}
|
|
360
|
-
url(
|
|
381
|
+
url(n) {
|
|
361
382
|
let e;
|
|
362
|
-
if (e = this.rules.inline.url.exec(
|
|
363
|
-
let r,
|
|
364
|
-
if (e[2] === "@") r = e[0],
|
|
383
|
+
if (e = this.rules.inline.url.exec(n)) {
|
|
384
|
+
let r, s;
|
|
385
|
+
if (e[2] === "@") r = e[0], s = "mailto:" + r;
|
|
365
386
|
else {
|
|
366
387
|
let t;
|
|
367
388
|
do
|
|
368
389
|
t = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])?.[0] ?? "";
|
|
369
390
|
while (t !== e[0]);
|
|
370
|
-
r = e[0], e[1] === "www." ?
|
|
391
|
+
r = e[0], e[1] === "www." ? s = "http://" + e[0] : s = e[0];
|
|
371
392
|
}
|
|
372
|
-
return { type: "link", raw: e[0], text: r, href:
|
|
393
|
+
return { type: "link", raw: e[0], text: r, href: s, tokens: [{ type: "text", raw: r, text: r }] };
|
|
373
394
|
}
|
|
374
395
|
}
|
|
375
|
-
inlineText(
|
|
376
|
-
let e = this.rules.inline.text.exec(
|
|
396
|
+
inlineText(n) {
|
|
397
|
+
let e = this.rules.inline.text.exec(n);
|
|
377
398
|
if (e) {
|
|
378
399
|
let r = this.lexer.state.inRawBlock;
|
|
379
400
|
return { type: "text", raw: e[0], text: e[0], escaped: r };
|
|
380
401
|
}
|
|
381
402
|
}
|
|
382
|
-
},
|
|
403
|
+
}, b = class D {
|
|
383
404
|
tokens;
|
|
384
405
|
options;
|
|
385
406
|
state;
|
|
386
407
|
inlineQueue;
|
|
387
408
|
tokenizer;
|
|
388
409
|
constructor(e) {
|
|
389
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || R, this.options.tokenizer = this.options.tokenizer || new
|
|
390
|
-
let r = { other: x, block: I.normal, inline:
|
|
391
|
-
this.options.pedantic ? (r.block = I.pedantic, r.inline =
|
|
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;
|
|
392
413
|
}
|
|
393
414
|
static get rules() {
|
|
394
|
-
return { block: I, inline:
|
|
415
|
+
return { block: I, inline: z };
|
|
395
416
|
}
|
|
396
417
|
static lex(e, r) {
|
|
397
|
-
return new
|
|
418
|
+
return new D(r).lex(e);
|
|
398
419
|
}
|
|
399
420
|
static lexInline(e, r) {
|
|
400
|
-
return new
|
|
421
|
+
return new D(r).inlineTokens(e);
|
|
401
422
|
}
|
|
402
423
|
lex(e) {
|
|
403
424
|
e = e.replace(x.carriageReturn, `
|
|
404
425
|
`), this.blockTokens(e, this.tokens);
|
|
405
426
|
for (let r = 0; r < this.inlineQueue.length; r++) {
|
|
406
|
-
let
|
|
407
|
-
this.inlineTokens(
|
|
427
|
+
let s = this.inlineQueue[r];
|
|
428
|
+
this.inlineTokens(s.src, s.tokens);
|
|
408
429
|
}
|
|
409
430
|
return this.inlineQueue = [], this.tokens;
|
|
410
431
|
}
|
|
411
|
-
blockTokens(e, r = [],
|
|
432
|
+
blockTokens(e, r = [], s = !1) {
|
|
412
433
|
for (this.options.pedantic && (e = e.replace(x.tabCharGlobal, " ").replace(x.spaceLine, "")); e; ) {
|
|
413
434
|
let t;
|
|
414
435
|
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;
|
|
@@ -478,10 +499,10 @@ ${c}` : c;
|
|
|
478
499
|
}
|
|
479
500
|
if (this.state.top && (t = this.tokenizer.paragraph(i))) {
|
|
480
501
|
let l = r.at(-1);
|
|
481
|
-
|
|
502
|
+
s && l?.type === "paragraph" ? (l.raw += (l.raw.endsWith(`
|
|
482
503
|
`) ? "" : `
|
|
483
504
|
`) + t.raw, l.text += `
|
|
484
|
-
` + t.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : r.push(t),
|
|
505
|
+
` + t.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : r.push(t), s = i.length !== e.length, e = e.substring(t.raw.length);
|
|
485
506
|
continue;
|
|
486
507
|
}
|
|
487
508
|
if (t = this.tokenizer.text(e)) {
|
|
@@ -507,15 +528,15 @@ ${c}` : c;
|
|
|
507
528
|
return this.inlineQueue.push({ src: e, tokens: r }), r;
|
|
508
529
|
}
|
|
509
530
|
inlineTokens(e, r = []) {
|
|
510
|
-
let
|
|
531
|
+
let s = e, t = null;
|
|
511
532
|
if (this.tokens.links) {
|
|
512
533
|
let a = Object.keys(this.tokens.links);
|
|
513
|
-
if (a.length > 0) for (; (t = this.tokenizer.rules.inline.reflinkSearch.exec(
|
|
534
|
+
if (a.length > 0) for (; (t = this.tokenizer.rules.inline.reflinkSearch.exec(s)) != null; ) a.includes(t[0].slice(t[0].lastIndexOf("[") + 1, -1)) && (s = s.slice(0, t.index) + "[" + "a".repeat(t[0].length - 2) + "]" + s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
|
|
514
535
|
}
|
|
515
|
-
for (; (t = this.tokenizer.rules.inline.anyPunctuation.exec(
|
|
536
|
+
for (; (t = this.tokenizer.rules.inline.anyPunctuation.exec(s)) != null; ) s = s.slice(0, t.index) + "++" + s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
516
537
|
let i;
|
|
517
|
-
for (; (t = this.tokenizer.rules.inline.blockSkip.exec(
|
|
518
|
-
|
|
538
|
+
for (; (t = this.tokenizer.rules.inline.blockSkip.exec(s)) != null; ) i = t[2] ? t[2].length : 0, s = s.slice(0, t.index + i) + "[" + "a".repeat(t[0].length - i - 2) + "]" + s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
539
|
+
s = this.options.hooks?.emStrongMask?.call({ lexer: this }, s) ?? s;
|
|
519
540
|
let l = !1, o = "";
|
|
520
541
|
for (; e; ) {
|
|
521
542
|
l || (o = ""), l = !1;
|
|
@@ -539,7 +560,7 @@ ${c}` : c;
|
|
|
539
560
|
a.type === "text" && c?.type === "text" ? (c.raw += a.raw, c.text += a.text) : r.push(a);
|
|
540
561
|
continue;
|
|
541
562
|
}
|
|
542
|
-
if (a = this.tokenizer.emStrong(e,
|
|
563
|
+
if (a = this.tokenizer.emStrong(e, s, o)) {
|
|
543
564
|
e = e.substring(a.raw.length), r.push(a);
|
|
544
565
|
continue;
|
|
545
566
|
}
|
|
@@ -551,7 +572,7 @@ ${c}` : c;
|
|
|
551
572
|
e = e.substring(a.raw.length), r.push(a);
|
|
552
573
|
continue;
|
|
553
574
|
}
|
|
554
|
-
if (a = this.tokenizer.del(e)) {
|
|
575
|
+
if (a = this.tokenizer.del(e, s, o)) {
|
|
555
576
|
e = e.substring(a.raw.length), r.push(a);
|
|
556
577
|
continue;
|
|
557
578
|
}
|
|
@@ -565,9 +586,9 @@ ${c}` : c;
|
|
|
565
586
|
}
|
|
566
587
|
let h = e;
|
|
567
588
|
if (this.options.extensions?.startInline) {
|
|
568
|
-
let c = 1 / 0,
|
|
589
|
+
let c = 1 / 0, g = e.slice(1), u;
|
|
569
590
|
this.options.extensions.startInline.forEach((d) => {
|
|
570
|
-
u = d.call({ lexer: this },
|
|
591
|
+
u = d.call({ lexer: this }, g), typeof u == "number" && u >= 0 && (c = Math.min(c, u));
|
|
571
592
|
}), c < 1 / 0 && c >= 0 && (h = e.substring(0, c + 1));
|
|
572
593
|
}
|
|
573
594
|
if (a = this.tokenizer.inlineText(h)) {
|
|
@@ -586,171 +607,171 @@ ${c}` : c;
|
|
|
586
607
|
}
|
|
587
608
|
return r;
|
|
588
609
|
}
|
|
589
|
-
},
|
|
610
|
+
}, B = class {
|
|
590
611
|
options;
|
|
591
612
|
parser;
|
|
592
|
-
constructor(
|
|
593
|
-
this.options =
|
|
613
|
+
constructor(n) {
|
|
614
|
+
this.options = n || R;
|
|
594
615
|
}
|
|
595
|
-
space(
|
|
616
|
+
space(n) {
|
|
596
617
|
return "";
|
|
597
618
|
}
|
|
598
|
-
code({ text:
|
|
599
|
-
let
|
|
619
|
+
code({ text: n, lang: e, escaped: r }) {
|
|
620
|
+
let s = (e || "").match(x.notSpaceStart)?.[0], t = n.replace(x.endingNewline, "") + `
|
|
600
621
|
`;
|
|
601
|
-
return
|
|
622
|
+
return s ? '<pre><code class="language-' + y(s) + '">' + (r ? t : y(t, !0)) + `</code></pre>
|
|
602
623
|
` : "<pre><code>" + (r ? t : y(t, !0)) + `</code></pre>
|
|
603
624
|
`;
|
|
604
625
|
}
|
|
605
|
-
blockquote({ tokens:
|
|
626
|
+
blockquote({ tokens: n }) {
|
|
606
627
|
return `<blockquote>
|
|
607
|
-
${this.parser.parse(
|
|
628
|
+
${this.parser.parse(n)}</blockquote>
|
|
608
629
|
`;
|
|
609
630
|
}
|
|
610
|
-
html({ text:
|
|
611
|
-
return
|
|
631
|
+
html({ text: n }) {
|
|
632
|
+
return n;
|
|
612
633
|
}
|
|
613
|
-
def(
|
|
634
|
+
def(n) {
|
|
614
635
|
return "";
|
|
615
636
|
}
|
|
616
|
-
heading({ tokens:
|
|
617
|
-
return `<h${e}>${this.parser.parseInline(
|
|
637
|
+
heading({ tokens: n, depth: e }) {
|
|
638
|
+
return `<h${e}>${this.parser.parseInline(n)}</h${e}>
|
|
618
639
|
`;
|
|
619
640
|
}
|
|
620
|
-
hr(
|
|
641
|
+
hr(n) {
|
|
621
642
|
return `<hr>
|
|
622
643
|
`;
|
|
623
644
|
}
|
|
624
|
-
list(
|
|
625
|
-
let e =
|
|
626
|
-
for (let l = 0; l <
|
|
627
|
-
let o =
|
|
628
|
-
|
|
645
|
+
list(n) {
|
|
646
|
+
let e = n.ordered, r = n.start, s = "";
|
|
647
|
+
for (let l = 0; l < n.items.length; l++) {
|
|
648
|
+
let o = n.items[l];
|
|
649
|
+
s += this.listitem(o);
|
|
629
650
|
}
|
|
630
651
|
let t = e ? "ol" : "ul", i = e && r !== 1 ? ' start="' + r + '"' : "";
|
|
631
652
|
return "<" + t + i + `>
|
|
632
|
-
` +
|
|
653
|
+
` + s + "</" + t + `>
|
|
633
654
|
`;
|
|
634
655
|
}
|
|
635
|
-
listitem(
|
|
636
|
-
return `<li>${this.parser.parse(
|
|
656
|
+
listitem(n) {
|
|
657
|
+
return `<li>${this.parser.parse(n.tokens)}</li>
|
|
637
658
|
`;
|
|
638
659
|
}
|
|
639
|
-
checkbox({ checked:
|
|
640
|
-
return "<input " + (
|
|
660
|
+
checkbox({ checked: n }) {
|
|
661
|
+
return "<input " + (n ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
|
|
641
662
|
}
|
|
642
|
-
paragraph({ tokens:
|
|
643
|
-
return `<p>${this.parser.parseInline(
|
|
663
|
+
paragraph({ tokens: n }) {
|
|
664
|
+
return `<p>${this.parser.parseInline(n)}</p>
|
|
644
665
|
`;
|
|
645
666
|
}
|
|
646
|
-
table(
|
|
667
|
+
table(n) {
|
|
647
668
|
let e = "", r = "";
|
|
648
|
-
for (let t = 0; t <
|
|
669
|
+
for (let t = 0; t < n.header.length; t++) r += this.tablecell(n.header[t]);
|
|
649
670
|
e += this.tablerow({ text: r });
|
|
650
|
-
let
|
|
651
|
-
for (let t = 0; t <
|
|
652
|
-
let i =
|
|
671
|
+
let s = "";
|
|
672
|
+
for (let t = 0; t < n.rows.length; t++) {
|
|
673
|
+
let i = n.rows[t];
|
|
653
674
|
r = "";
|
|
654
675
|
for (let l = 0; l < i.length; l++) r += this.tablecell(i[l]);
|
|
655
|
-
|
|
676
|
+
s += this.tablerow({ text: r });
|
|
656
677
|
}
|
|
657
|
-
return
|
|
678
|
+
return s && (s = `<tbody>${s}</tbody>`), `<table>
|
|
658
679
|
<thead>
|
|
659
680
|
` + e + `</thead>
|
|
660
|
-
` +
|
|
681
|
+
` + s + `</table>
|
|
661
682
|
`;
|
|
662
683
|
}
|
|
663
|
-
tablerow({ text:
|
|
684
|
+
tablerow({ text: n }) {
|
|
664
685
|
return `<tr>
|
|
665
|
-
${
|
|
686
|
+
${n}</tr>
|
|
666
687
|
`;
|
|
667
688
|
}
|
|
668
|
-
tablecell(
|
|
669
|
-
let e = this.parser.parseInline(
|
|
670
|
-
return (
|
|
689
|
+
tablecell(n) {
|
|
690
|
+
let e = this.parser.parseInline(n.tokens), r = n.header ? "th" : "td";
|
|
691
|
+
return (n.align ? `<${r} align="${n.align}">` : `<${r}>`) + e + `</${r}>
|
|
671
692
|
`;
|
|
672
693
|
}
|
|
673
|
-
strong({ tokens:
|
|
674
|
-
return `<strong>${this.parser.parseInline(
|
|
694
|
+
strong({ tokens: n }) {
|
|
695
|
+
return `<strong>${this.parser.parseInline(n)}</strong>`;
|
|
675
696
|
}
|
|
676
|
-
em({ tokens:
|
|
677
|
-
return `<em>${this.parser.parseInline(
|
|
697
|
+
em({ tokens: n }) {
|
|
698
|
+
return `<em>${this.parser.parseInline(n)}</em>`;
|
|
678
699
|
}
|
|
679
|
-
codespan({ text:
|
|
680
|
-
return `<code>${y(
|
|
700
|
+
codespan({ text: n }) {
|
|
701
|
+
return `<code>${y(n, !0)}</code>`;
|
|
681
702
|
}
|
|
682
|
-
br(
|
|
703
|
+
br(n) {
|
|
683
704
|
return "<br>";
|
|
684
705
|
}
|
|
685
|
-
del({ tokens:
|
|
686
|
-
return `<del>${this.parser.parseInline(
|
|
706
|
+
del({ tokens: n }) {
|
|
707
|
+
return `<del>${this.parser.parseInline(n)}</del>`;
|
|
687
708
|
}
|
|
688
|
-
link({ href:
|
|
689
|
-
let
|
|
690
|
-
if (t === null) return
|
|
691
|
-
|
|
692
|
-
let i = '<a href="' +
|
|
693
|
-
return e && (i += ' title="' + y(e) + '"'), i += ">" +
|
|
709
|
+
link({ href: n, title: e, tokens: r }) {
|
|
710
|
+
let s = this.parser.parseInline(r), t = te(n);
|
|
711
|
+
if (t === null) return s;
|
|
712
|
+
n = t;
|
|
713
|
+
let i = '<a href="' + n + '"';
|
|
714
|
+
return e && (i += ' title="' + y(e) + '"'), i += ">" + s + "</a>", i;
|
|
694
715
|
}
|
|
695
|
-
image({ href:
|
|
696
|
-
|
|
697
|
-
let t = te(
|
|
716
|
+
image({ href: n, title: e, text: r, tokens: s }) {
|
|
717
|
+
s && (r = this.parser.parseInline(s, this.parser.textRenderer));
|
|
718
|
+
let t = te(n);
|
|
698
719
|
if (t === null) return y(r);
|
|
699
|
-
|
|
700
|
-
let i = `<img src="${
|
|
720
|
+
n = t;
|
|
721
|
+
let i = `<img src="${n}" alt="${r}"`;
|
|
701
722
|
return e && (i += ` title="${y(e)}"`), i += ">", i;
|
|
702
723
|
}
|
|
703
|
-
text(
|
|
704
|
-
return "tokens" in
|
|
724
|
+
text(n) {
|
|
725
|
+
return "tokens" in n && n.tokens ? this.parser.parseInline(n.tokens) : "escaped" in n && n.escaped ? n.text : y(n.text);
|
|
705
726
|
}
|
|
706
727
|
}, W = class {
|
|
707
|
-
strong({ text:
|
|
708
|
-
return
|
|
728
|
+
strong({ text: n }) {
|
|
729
|
+
return n;
|
|
709
730
|
}
|
|
710
|
-
em({ text:
|
|
711
|
-
return
|
|
731
|
+
em({ text: n }) {
|
|
732
|
+
return n;
|
|
712
733
|
}
|
|
713
|
-
codespan({ text:
|
|
714
|
-
return
|
|
734
|
+
codespan({ text: n }) {
|
|
735
|
+
return n;
|
|
715
736
|
}
|
|
716
|
-
del({ text:
|
|
717
|
-
return
|
|
737
|
+
del({ text: n }) {
|
|
738
|
+
return n;
|
|
718
739
|
}
|
|
719
|
-
html({ text:
|
|
720
|
-
return
|
|
740
|
+
html({ text: n }) {
|
|
741
|
+
return n;
|
|
721
742
|
}
|
|
722
|
-
text({ text:
|
|
723
|
-
return
|
|
743
|
+
text({ text: n }) {
|
|
744
|
+
return n;
|
|
724
745
|
}
|
|
725
|
-
link({ text:
|
|
726
|
-
return "" +
|
|
746
|
+
link({ text: n }) {
|
|
747
|
+
return "" + n;
|
|
727
748
|
}
|
|
728
|
-
image({ text:
|
|
729
|
-
return "" +
|
|
749
|
+
image({ text: n }) {
|
|
750
|
+
return "" + n;
|
|
730
751
|
}
|
|
731
752
|
br() {
|
|
732
753
|
return "";
|
|
733
754
|
}
|
|
734
|
-
checkbox({ raw:
|
|
735
|
-
return
|
|
755
|
+
checkbox({ raw: n }) {
|
|
756
|
+
return n;
|
|
736
757
|
}
|
|
737
|
-
},
|
|
758
|
+
}, w = class M {
|
|
738
759
|
options;
|
|
739
760
|
renderer;
|
|
740
761
|
textRenderer;
|
|
741
762
|
constructor(e) {
|
|
742
|
-
this.options = e || R, this.options.renderer = this.options.renderer || new
|
|
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 W();
|
|
743
764
|
}
|
|
744
765
|
static parse(e, r) {
|
|
745
|
-
return new
|
|
766
|
+
return new M(r).parse(e);
|
|
746
767
|
}
|
|
747
768
|
static parseInline(e, r) {
|
|
748
|
-
return new
|
|
769
|
+
return new M(r).parseInline(e);
|
|
749
770
|
}
|
|
750
771
|
parse(e) {
|
|
751
772
|
let r = "";
|
|
752
|
-
for (let
|
|
753
|
-
let t = e[
|
|
773
|
+
for (let s = 0; s < e.length; s++) {
|
|
774
|
+
let t = e[s];
|
|
754
775
|
if (this.options.extensions?.renderers?.[t.type]) {
|
|
755
776
|
let l = t, o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
|
|
756
777
|
if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(l.type)) {
|
|
@@ -818,60 +839,60 @@ ${s}</tr>
|
|
|
818
839
|
return r;
|
|
819
840
|
}
|
|
820
841
|
parseInline(e, r = this.renderer) {
|
|
821
|
-
let
|
|
842
|
+
let s = "";
|
|
822
843
|
for (let t = 0; t < e.length; t++) {
|
|
823
844
|
let i = e[t];
|
|
824
845
|
if (this.options.extensions?.renderers?.[i.type]) {
|
|
825
846
|
let o = this.options.extensions.renderers[i.type].call({ parser: this }, i);
|
|
826
847
|
if (o !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
|
|
827
|
-
|
|
848
|
+
s += o || "";
|
|
828
849
|
continue;
|
|
829
850
|
}
|
|
830
851
|
}
|
|
831
852
|
let l = i;
|
|
832
853
|
switch (l.type) {
|
|
833
854
|
case "escape": {
|
|
834
|
-
|
|
855
|
+
s += r.text(l);
|
|
835
856
|
break;
|
|
836
857
|
}
|
|
837
858
|
case "html": {
|
|
838
|
-
|
|
859
|
+
s += r.html(l);
|
|
839
860
|
break;
|
|
840
861
|
}
|
|
841
862
|
case "link": {
|
|
842
|
-
|
|
863
|
+
s += r.link(l);
|
|
843
864
|
break;
|
|
844
865
|
}
|
|
845
866
|
case "image": {
|
|
846
|
-
|
|
867
|
+
s += r.image(l);
|
|
847
868
|
break;
|
|
848
869
|
}
|
|
849
870
|
case "checkbox": {
|
|
850
|
-
|
|
871
|
+
s += r.checkbox(l);
|
|
851
872
|
break;
|
|
852
873
|
}
|
|
853
874
|
case "strong": {
|
|
854
|
-
|
|
875
|
+
s += r.strong(l);
|
|
855
876
|
break;
|
|
856
877
|
}
|
|
857
878
|
case "em": {
|
|
858
|
-
|
|
879
|
+
s += r.em(l);
|
|
859
880
|
break;
|
|
860
881
|
}
|
|
861
882
|
case "codespan": {
|
|
862
|
-
|
|
883
|
+
s += r.codespan(l);
|
|
863
884
|
break;
|
|
864
885
|
}
|
|
865
886
|
case "br": {
|
|
866
|
-
|
|
887
|
+
s += r.br(l);
|
|
867
888
|
break;
|
|
868
889
|
}
|
|
869
890
|
case "del": {
|
|
870
|
-
|
|
891
|
+
s += r.del(l);
|
|
871
892
|
break;
|
|
872
893
|
}
|
|
873
894
|
case "text": {
|
|
874
|
-
|
|
895
|
+
s += r.text(l);
|
|
875
896
|
break;
|
|
876
897
|
}
|
|
877
898
|
default: {
|
|
@@ -881,64 +902,64 @@ ${s}</tr>
|
|
|
881
902
|
}
|
|
882
903
|
}
|
|
883
904
|
}
|
|
884
|
-
return
|
|
905
|
+
return s;
|
|
885
906
|
}
|
|
886
|
-
},
|
|
907
|
+
}, _ = class {
|
|
887
908
|
options;
|
|
888
909
|
block;
|
|
889
|
-
constructor(
|
|
890
|
-
this.options =
|
|
910
|
+
constructor(n) {
|
|
911
|
+
this.options = n || R;
|
|
891
912
|
}
|
|
892
913
|
static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
|
|
893
914
|
static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
|
|
894
|
-
preprocess(
|
|
895
|
-
return
|
|
915
|
+
preprocess(n) {
|
|
916
|
+
return n;
|
|
896
917
|
}
|
|
897
|
-
postprocess(
|
|
898
|
-
return
|
|
918
|
+
postprocess(n) {
|
|
919
|
+
return n;
|
|
899
920
|
}
|
|
900
|
-
processAllTokens(
|
|
901
|
-
return
|
|
921
|
+
processAllTokens(n) {
|
|
922
|
+
return n;
|
|
902
923
|
}
|
|
903
|
-
emStrongMask(
|
|
904
|
-
return
|
|
924
|
+
emStrongMask(n) {
|
|
925
|
+
return n;
|
|
905
926
|
}
|
|
906
927
|
provideLexer() {
|
|
907
|
-
return this.block ?
|
|
928
|
+
return this.block ? b.lex : b.lexInline;
|
|
908
929
|
}
|
|
909
930
|
provideParser() {
|
|
910
|
-
return this.block ?
|
|
931
|
+
return this.block ? w.parse : w.parseInline;
|
|
911
932
|
}
|
|
912
|
-
},
|
|
913
|
-
defaults =
|
|
933
|
+
}, it = class {
|
|
934
|
+
defaults = Q();
|
|
914
935
|
options = this.setOptions;
|
|
915
936
|
parse = this.parseMarkdown(!0);
|
|
916
937
|
parseInline = this.parseMarkdown(!1);
|
|
917
|
-
Parser =
|
|
918
|
-
Renderer =
|
|
938
|
+
Parser = w;
|
|
939
|
+
Renderer = B;
|
|
919
940
|
TextRenderer = W;
|
|
920
|
-
Lexer =
|
|
921
|
-
Tokenizer =
|
|
922
|
-
Hooks =
|
|
923
|
-
constructor(...
|
|
924
|
-
this.use(...
|
|
941
|
+
Lexer = b;
|
|
942
|
+
Tokenizer = q;
|
|
943
|
+
Hooks = _;
|
|
944
|
+
constructor(...n) {
|
|
945
|
+
this.use(...n);
|
|
925
946
|
}
|
|
926
|
-
walkTokens(
|
|
947
|
+
walkTokens(n, e) {
|
|
927
948
|
let r = [];
|
|
928
|
-
for (let
|
|
949
|
+
for (let s of n) switch (r = r.concat(e.call(this, s)), s.type) {
|
|
929
950
|
case "table": {
|
|
930
|
-
let t =
|
|
951
|
+
let t = s;
|
|
931
952
|
for (let i of t.header) r = r.concat(this.walkTokens(i.tokens, e));
|
|
932
953
|
for (let i of t.rows) for (let l of i) r = r.concat(this.walkTokens(l.tokens, e));
|
|
933
954
|
break;
|
|
934
955
|
}
|
|
935
956
|
case "list": {
|
|
936
|
-
let t =
|
|
957
|
+
let t = s;
|
|
937
958
|
r = r.concat(this.walkTokens(t.items, e));
|
|
938
959
|
break;
|
|
939
960
|
}
|
|
940
961
|
default: {
|
|
941
|
-
let t =
|
|
962
|
+
let t = s;
|
|
942
963
|
this.defaults.extensions?.childTokens?.[t.type] ? this.defaults.extensions.childTokens[t.type].forEach((i) => {
|
|
943
964
|
let l = t[i].flat(1 / 0);
|
|
944
965
|
r = r.concat(this.walkTokens(l, e));
|
|
@@ -947,11 +968,11 @@ ${s}</tr>
|
|
|
947
968
|
}
|
|
948
969
|
return r;
|
|
949
970
|
}
|
|
950
|
-
use(...
|
|
971
|
+
use(...n) {
|
|
951
972
|
let e = this.defaults.extensions || { renderers: {}, childTokens: {} };
|
|
952
|
-
return
|
|
953
|
-
let
|
|
954
|
-
if (
|
|
973
|
+
return n.forEach((r) => {
|
|
974
|
+
let s = { ...r };
|
|
975
|
+
if (s.async = this.defaults.async || s.async || !1, r.extensions && (r.extensions.forEach((t) => {
|
|
955
976
|
if (!t.name) throw new Error("extension name required");
|
|
956
977
|
if ("renderer" in t) {
|
|
957
978
|
let i = e.renderers[t.name];
|
|
@@ -966,8 +987,8 @@ ${s}</tr>
|
|
|
966
987
|
i ? i.unshift(t.tokenizer) : e[t.level] = [t.tokenizer], t.start && (t.level === "block" ? e.startBlock ? e.startBlock.push(t.start) : e.startBlock = [t.start] : t.level === "inline" && (e.startInline ? e.startInline.push(t.start) : e.startInline = [t.start]));
|
|
967
988
|
}
|
|
968
989
|
"childTokens" in t && t.childTokens && (e.childTokens[t.name] = t.childTokens);
|
|
969
|
-
}),
|
|
970
|
-
let t = this.defaults.renderer || new
|
|
990
|
+
}), s.extensions = e), r.renderer) {
|
|
991
|
+
let t = this.defaults.renderer || new B(this.defaults);
|
|
971
992
|
for (let i in r.renderer) {
|
|
972
993
|
if (!(i in t)) throw new Error(`renderer '${i}' does not exist`);
|
|
973
994
|
if (["options", "parser"].includes(i)) continue;
|
|
@@ -977,10 +998,10 @@ ${s}</tr>
|
|
|
977
998
|
return c === !1 && (c = a.apply(t, h)), c || "";
|
|
978
999
|
};
|
|
979
1000
|
}
|
|
980
|
-
|
|
1001
|
+
s.renderer = t;
|
|
981
1002
|
}
|
|
982
1003
|
if (r.tokenizer) {
|
|
983
|
-
let t = this.defaults.tokenizer || new
|
|
1004
|
+
let t = this.defaults.tokenizer || new q(this.defaults);
|
|
984
1005
|
for (let i in r.tokenizer) {
|
|
985
1006
|
if (!(i in t)) throw new Error(`tokenizer '${i}' does not exist`);
|
|
986
1007
|
if (["options", "rules", "lexer"].includes(i)) continue;
|
|
@@ -990,134 +1011,134 @@ ${s}</tr>
|
|
|
990
1011
|
return c === !1 && (c = a.apply(t, h)), c;
|
|
991
1012
|
};
|
|
992
1013
|
}
|
|
993
|
-
|
|
1014
|
+
s.tokenizer = t;
|
|
994
1015
|
}
|
|
995
1016
|
if (r.hooks) {
|
|
996
|
-
let t = this.defaults.hooks || new
|
|
1017
|
+
let t = this.defaults.hooks || new _();
|
|
997
1018
|
for (let i in r.hooks) {
|
|
998
1019
|
if (!(i in t)) throw new Error(`hook '${i}' does not exist`);
|
|
999
1020
|
if (["options", "block"].includes(i)) continue;
|
|
1000
1021
|
let l = i, o = r.hooks[l], a = t[l];
|
|
1001
|
-
|
|
1002
|
-
if (this.defaults.async &&
|
|
1003
|
-
let
|
|
1004
|
-
return a.call(t,
|
|
1022
|
+
_.passThroughHooks.has(i) ? t[l] = (h) => {
|
|
1023
|
+
if (this.defaults.async && _.passThroughHooksRespectAsync.has(i)) return (async () => {
|
|
1024
|
+
let g = await o.call(t, h);
|
|
1025
|
+
return a.call(t, g);
|
|
1005
1026
|
})();
|
|
1006
1027
|
let c = o.call(t, h);
|
|
1007
1028
|
return a.call(t, c);
|
|
1008
1029
|
} : t[l] = (...h) => {
|
|
1009
1030
|
if (this.defaults.async) return (async () => {
|
|
1010
|
-
let
|
|
1011
|
-
return
|
|
1031
|
+
let g = await o.apply(t, h);
|
|
1032
|
+
return g === !1 && (g = await a.apply(t, h)), g;
|
|
1012
1033
|
})();
|
|
1013
1034
|
let c = o.apply(t, h);
|
|
1014
1035
|
return c === !1 && (c = a.apply(t, h)), c;
|
|
1015
1036
|
};
|
|
1016
1037
|
}
|
|
1017
|
-
|
|
1038
|
+
s.hooks = t;
|
|
1018
1039
|
}
|
|
1019
1040
|
if (r.walkTokens) {
|
|
1020
1041
|
let t = this.defaults.walkTokens, i = r.walkTokens;
|
|
1021
|
-
|
|
1042
|
+
s.walkTokens = function(l) {
|
|
1022
1043
|
let o = [];
|
|
1023
1044
|
return o.push(i.call(this, l)), t && (o = o.concat(t.call(this, l))), o;
|
|
1024
1045
|
};
|
|
1025
1046
|
}
|
|
1026
|
-
this.defaults = { ...this.defaults, ...
|
|
1047
|
+
this.defaults = { ...this.defaults, ...s };
|
|
1027
1048
|
}), this;
|
|
1028
1049
|
}
|
|
1029
|
-
setOptions(
|
|
1030
|
-
return this.defaults = { ...this.defaults, ...
|
|
1050
|
+
setOptions(n) {
|
|
1051
|
+
return this.defaults = { ...this.defaults, ...n }, this;
|
|
1031
1052
|
}
|
|
1032
|
-
lexer(
|
|
1033
|
-
return
|
|
1053
|
+
lexer(n, e) {
|
|
1054
|
+
return b.lex(n, e ?? this.defaults);
|
|
1034
1055
|
}
|
|
1035
|
-
parser(
|
|
1036
|
-
return
|
|
1056
|
+
parser(n, e) {
|
|
1057
|
+
return w.parse(n, e ?? this.defaults);
|
|
1037
1058
|
}
|
|
1038
|
-
parseMarkdown(
|
|
1059
|
+
parseMarkdown(n) {
|
|
1039
1060
|
return (e, r) => {
|
|
1040
|
-
let
|
|
1041
|
-
if (this.defaults.async === !0 &&
|
|
1061
|
+
let s = { ...r }, t = { ...this.defaults, ...s }, i = this.onError(!!t.silent, !!t.async);
|
|
1062
|
+
if (this.defaults.async === !0 && s.async === !1) return i(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."));
|
|
1042
1063
|
if (typeof e > "u" || e === null) return i(new Error("marked(): input parameter is undefined or null"));
|
|
1043
1064
|
if (typeof e != "string") return i(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
|
|
1044
|
-
if (t.hooks && (t.hooks.options = t, t.hooks.block =
|
|
1045
|
-
let l = t.hooks ? await t.hooks.preprocess(e) : e, o = await (t.hooks ? await t.hooks.provideLexer() :
|
|
1065
|
+
if (t.hooks && (t.hooks.options = t, t.hooks.block = n), t.async) return (async () => {
|
|
1066
|
+
let l = t.hooks ? await t.hooks.preprocess(e) : e, o = await (t.hooks ? await t.hooks.provideLexer() : n ? b.lex : b.lexInline)(l, t), a = t.hooks ? await t.hooks.processAllTokens(o) : o;
|
|
1046
1067
|
t.walkTokens && await Promise.all(this.walkTokens(a, t.walkTokens));
|
|
1047
|
-
let h = await (t.hooks ? await t.hooks.provideParser() :
|
|
1068
|
+
let h = await (t.hooks ? await t.hooks.provideParser() : n ? w.parse : w.parseInline)(a, t);
|
|
1048
1069
|
return t.hooks ? await t.hooks.postprocess(h) : h;
|
|
1049
1070
|
})().catch(i);
|
|
1050
1071
|
try {
|
|
1051
1072
|
t.hooks && (e = t.hooks.preprocess(e));
|
|
1052
|
-
let l = (t.hooks ? t.hooks.provideLexer() :
|
|
1073
|
+
let l = (t.hooks ? t.hooks.provideLexer() : n ? b.lex : b.lexInline)(e, t);
|
|
1053
1074
|
t.hooks && (l = t.hooks.processAllTokens(l)), t.walkTokens && this.walkTokens(l, t.walkTokens);
|
|
1054
|
-
let o = (t.hooks ? t.hooks.provideParser() :
|
|
1075
|
+
let o = (t.hooks ? t.hooks.provideParser() : n ? w.parse : w.parseInline)(l, t);
|
|
1055
1076
|
return t.hooks && (o = t.hooks.postprocess(o)), o;
|
|
1056
1077
|
} catch (l) {
|
|
1057
1078
|
return i(l);
|
|
1058
1079
|
}
|
|
1059
1080
|
};
|
|
1060
1081
|
}
|
|
1061
|
-
onError(
|
|
1082
|
+
onError(n, e) {
|
|
1062
1083
|
return (r) => {
|
|
1063
1084
|
if (r.message += `
|
|
1064
|
-
Please report this to https://github.com/markedjs/marked.`,
|
|
1065
|
-
let
|
|
1066
|
-
return e ? Promise.resolve(
|
|
1085
|
+
Please report this to https://github.com/markedjs/marked.`, n) {
|
|
1086
|
+
let s = "<p>An error occurred:</p><pre>" + y(r.message + "", !0) + "</pre>";
|
|
1087
|
+
return e ? Promise.resolve(s) : s;
|
|
1067
1088
|
}
|
|
1068
1089
|
if (e) return Promise.reject(r);
|
|
1069
1090
|
throw r;
|
|
1070
1091
|
};
|
|
1071
1092
|
}
|
|
1072
|
-
},
|
|
1073
|
-
function
|
|
1074
|
-
return
|
|
1093
|
+
}, S = new it();
|
|
1094
|
+
function k(n, e) {
|
|
1095
|
+
return S.parse(n, e);
|
|
1075
1096
|
}
|
|
1076
|
-
|
|
1077
|
-
return
|
|
1097
|
+
k.options = k.setOptions = function(n) {
|
|
1098
|
+
return S.setOptions(n), k.defaults = S.defaults, se(k.defaults), k;
|
|
1078
1099
|
};
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
return
|
|
1100
|
+
k.getDefaults = Q;
|
|
1101
|
+
k.defaults = R;
|
|
1102
|
+
k.use = function(...n) {
|
|
1103
|
+
return S.use(...n), k.defaults = S.defaults, se(k.defaults), k;
|
|
1083
1104
|
};
|
|
1084
|
-
|
|
1085
|
-
return
|
|
1105
|
+
k.walkTokens = function(n, e) {
|
|
1106
|
+
return S.walkTokens(n, e);
|
|
1086
1107
|
};
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1108
|
+
k.parseInline = S.parseInline;
|
|
1109
|
+
k.Parser = w;
|
|
1110
|
+
k.parser = w.parse;
|
|
1111
|
+
k.Renderer = B;
|
|
1112
|
+
k.TextRenderer = W;
|
|
1113
|
+
k.Lexer = b;
|
|
1114
|
+
k.lexer = b.lex;
|
|
1115
|
+
k.Tokenizer = q;
|
|
1116
|
+
k.Hooks = _;
|
|
1117
|
+
k.parse = k;
|
|
1118
|
+
k.options;
|
|
1119
|
+
k.setOptions;
|
|
1120
|
+
k.use;
|
|
1121
|
+
k.walkTokens;
|
|
1122
|
+
k.parseInline;
|
|
1123
|
+
w.parse;
|
|
1124
|
+
b.lex;
|
|
1125
|
+
k.use({
|
|
1105
1126
|
gfm: !0,
|
|
1106
1127
|
breaks: !0,
|
|
1107
1128
|
async: !1,
|
|
1108
1129
|
renderer: {
|
|
1109
|
-
link({ href:
|
|
1110
|
-
const
|
|
1111
|
-
return `<calcite-link href="${
|
|
1130
|
+
link({ href: n, title: e, tokens: r }) {
|
|
1131
|
+
const s = this.parser.parseInline(r);
|
|
1132
|
+
return `<calcite-link href="${n}" title="${e ?? s}" target="Arcade Help">${s}</calcite-link>`;
|
|
1112
1133
|
},
|
|
1113
|
-
code({ lang:
|
|
1114
|
-
return `<arcgis-code-viewer language="${
|
|
1134
|
+
code({ lang: n, text: e }) {
|
|
1135
|
+
return `<arcgis-code-viewer language="${n === "sql" ? "arcgis-sql-expression" : n}">${e}</arcgis-code-viewer>`;
|
|
1115
1136
|
}
|
|
1116
1137
|
}
|
|
1117
1138
|
});
|
|
1118
|
-
function
|
|
1119
|
-
return
|
|
1139
|
+
function at(n) {
|
|
1140
|
+
return n == null ? "" : k.parse(typeof n == "string" ? n : n.value, { async: !1 });
|
|
1120
1141
|
}
|
|
1121
1142
|
export {
|
|
1122
|
-
|
|
1143
|
+
at as c
|
|
1123
1144
|
};
|