@elmethis/core 0.6.3 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/components/code/ElmCodeBlock.vue2.mjs +5 -5
- package/dist/components/code/ElmMermaid.stories.d.ts +7 -0
- package/dist/components/code/ElmMermaid.vue.d.ts +7 -0
- package/dist/components/code/ElmMermaid.vue.mjs +10 -0
- package/dist/components/code/ElmMermaid.vue2.mjs +59 -0
- package/dist/components/code/ElmMermaid.vue3.mjs +26 -0
- package/dist/components/containments/ElmConfirmModal.vue2.mjs +2 -2
- package/dist/components/containments/ElmDesktopWindow.vue2.mjs +1 -1
- package/dist/components/containments/ElmModal.vue2.mjs +2 -2
- package/dist/components/containments/ElmParallax.vue2.mjs +2 -2
- package/dist/components/containments/ElmSimpleTooltip.vue2.mjs +3 -3
- package/dist/components/containments/ElmSnackbar.vue2.mjs +2 -2
- package/dist/components/containments/ElmSnackbarContainer.vue2.mjs +1 -1
- package/dist/components/containments/ElmToggle.vue2.mjs +3 -3
- package/dist/components/data/ElmMultiProgress.vue2.mjs +2 -2
- package/dist/components/data/ElmProgress.vue2.mjs +8 -8
- package/dist/components/data/ElmStatusMessage.vue2.mjs +7 -7
- package/dist/components/fallback/ElmSpinner.vue2.mjs +6 -6
- package/dist/components/fallback/ElmUnsupportedBlock.vue2.mjs +2 -2
- package/dist/components/form/ElmButton.vue2.mjs +10 -10
- package/dist/components/form/ElmCheckbox.vue2.mjs +1 -1
- package/dist/components/form/ElmSelect.vue2.mjs +3 -3
- package/dist/components/form/ElmSwitch.vue2.mjs +5 -5
- package/dist/components/form/ElmTextField.vue2.mjs +15 -15
- package/dist/components/form/ElmValidation.vue2.mjs +5 -5
- package/dist/components/icon/ElmArrowIcon.vue2.mjs +5 -5
- package/dist/components/icon/ElmBookmarkIcon.vue2.mjs +5 -5
- package/dist/components/icon/ElmCubeIcon.vue2.mjs +2 -2
- package/dist/components/icon/ElmDotLoadingIcon.vue2.mjs +2 -2
- package/dist/components/icon/ElmInlineIcon.vue2.mjs +1 -1
- package/dist/components/icon/ElmLanguageIcon.vue2.mjs +2 -2
- package/dist/components/icon/ElmLoginIcon.vue2.mjs +4 -4
- package/dist/components/icon/ElmMdiIcon.vue2.mjs +5 -5
- package/dist/components/icon/ElmSquareLoadingIcon.vue2.mjs +4 -4
- package/dist/components/icon/ElmToggleTheme.vue2.mjs +4 -4
- package/dist/components/icon/languages/Bash.vue2.mjs +2 -2
- package/dist/components/icon/languages/C.vue2.mjs +2 -2
- package/dist/components/icon/languages/Cplusplus.vue2.mjs +2 -2
- package/dist/components/icon/languages/Csharp.vue2.mjs +2 -2
- package/dist/components/icon/languages/Css.vue2.mjs +2 -2
- package/dist/components/icon/languages/Go.vue2.mjs +2 -2
- package/dist/components/icon/languages/Html.vue2.mjs +2 -2
- package/dist/components/icon/languages/Java.vue2.mjs +2 -2
- package/dist/components/icon/languages/Javascript.vue2.mjs +2 -2
- package/dist/components/icon/languages/Json.vue2.mjs +2 -2
- package/dist/components/icon/languages/Kotlin.vue2.mjs +2 -2
- package/dist/components/icon/languages/Lua.vue2.mjs +2 -2
- package/dist/components/icon/languages/Npm.vue2.mjs +2 -2
- package/dist/components/icon/languages/Python.vue2.mjs +2 -2
- package/dist/components/icon/languages/Rust.vue2.mjs +2 -2
- package/dist/components/icon/languages/Sql.vue2.mjs +2 -2
- package/dist/components/icon/languages/Terraform.vue2.mjs +2 -2
- package/dist/components/icon/languages/Typescript copy.vue2.mjs +2 -2
- package/dist/components/icon/languages/Typescript.vue2.mjs +2 -2
- package/dist/components/media/ElmFile.vue2.mjs +6 -6
- package/dist/components/media/ElmImage.vue2.mjs +11 -11
- package/dist/components/navigation/ElmBookmark.vue2.mjs +16 -16
- package/dist/components/navigation/ElmBreadcrumb.vue2.mjs +3 -3
- package/dist/components/navigation/ElmPagetop.vue2.mjs +2 -2
- package/dist/components/navigation/ElmTableOfContents.vue2.mjs +1 -1
- package/dist/components/others/ElmColorSample.vue2.mjs +2 -2
- package/dist/components/others/ElmColorTable.vue2.mjs +1 -1
- package/dist/components/others/ElmJsonComponentRenderer.vue.d.ts +1 -1
- package/dist/components/others/ElmJsonComponentRenderer.vue2.mjs +25 -10
- package/dist/components/others/ElmMarkdown.vue.d.ts +1 -1
- package/dist/components/others/ElmMarkdown.vue.mjs +12 -7
- package/dist/components/table/ElmTable.vue2.mjs +3 -3
- package/dist/components/table/ElmTableCell.vue2.mjs +4 -4
- package/dist/components/typography/ElmBlockQuote.vue2.mjs +4 -4
- package/dist/components/typography/ElmCallout.vue2.mjs +6 -6
- package/dist/components/typography/ElmDivider.vue2.mjs +1 -1
- package/dist/components/typography/ElmFragmentIdentifier.vue2.mjs +1 -1
- package/dist/components/typography/ElmHeading.vue2.mjs +6 -6
- package/dist/components/typography/ElmInlineText.vue2.mjs +9 -9
- package/dist/components/typography/ElmList.vue.mjs +2 -2
- package/dist/components/typography/ElmTypingAnimation.vue2.mjs +1 -1
- package/dist/node_modules/.pnpm/{marked@16.3.0 → marked@16.4.0}/node_modules/marked/lib/marked.esm.mjs +193 -183
- package/package.json +12 -11
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
function L() {
|
|
2
2
|
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
3
3
|
}
|
|
4
|
-
var
|
|
5
|
-
function G(
|
|
6
|
-
|
|
4
|
+
var T = L();
|
|
5
|
+
function G(u3) {
|
|
6
|
+
T = u3;
|
|
7
7
|
}
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
let t = typeof
|
|
8
|
+
var I = { exec: () => null };
|
|
9
|
+
function d(u3, e = "") {
|
|
10
|
+
let t = typeof u3 == "string" ? u3 : u3.source, n = { replace: (r, i) => {
|
|
11
11
|
let s = typeof i == "string" ? i : i.source;
|
|
12
12
|
return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
|
|
13
13
|
}, getRegex: () => new RegExp(t, e) };
|
|
14
14
|
return n;
|
|
15
15
|
}
|
|
16
|
-
var m = { 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, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ 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: (
|
|
17
|
-
]`).replace("lheading",
|
|
18
|
-
var
|
|
19
|
-
function w(
|
|
16
|
+
var m = { 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, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ 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: (u3) => new RegExp(`^( {0,3}${u3})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}#`), htmlBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}<(?:[a-z].*>|!--)`, "i") }, be = /^(?:[ \t]*(?:\n|$))+/, Re = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Te = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, E = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Oe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, F = /(?:[*+-]|\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+|$)/, oe = d(ie).replace(/bull/g, F).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(), we = d(ie).replace(/bull/g, F).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(), j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, ye = /^[^\n]+/, Q = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Pe = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Se = d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, F).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", U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, $e = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ae = d(j).replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), _e = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex(), K = { blockquote: _e, code: Re, def: Pe, fences: Te, heading: Oe, hr: E, html: $e, lheading: oe, list: Se, newline: be, paragraph: ae, table: I, text: ye }, re = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), Le = { ...K, lheading: we, table: re, paragraph: d(j).replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex() }, Me = { ...K, html: d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", U).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: I, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: d(j).replace("hr", E).replace("heading", ` *#{1,6} *[^
|
|
17
|
+
]`).replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, ze = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ae = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, le = /^( {2,}|\\)\n(?!\s*$)/, Ie = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, D = /[\p{P}\p{S}]/u, W = /[\s\p{P}\p{S}]/u, ue = /[^\s\p{P}\p{S}]/u, Ee = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex(), pe = /(?!~)[\p{P}\p{S}]/u, Ce = /(?!~)[\s\p{P}\p{S}]/u, Be = /(?:[^\s\p{P}\p{S}]|~)/u, qe = /\[(?:[^\[\]`]|`[^`]*?`)*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g, ce = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, ve = d(ce, "u").replace(/punct/g, D).getRegex(), De = d(ce, "u").replace(/punct/g, pe).getRegex(), he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", He = d(he, "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(), Ze = d(he, "gu").replace(/notPunctSpace/g, Be).replace(/punctSpace/g, Ce).replace(/punct/g, pe).getRegex(), Ge = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(), Ne = d(/\\(punct)/, "gu").replace(/punct/g, D).getRegex(), Fe = d(/^<(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 = d(U).replace("(?:-->|$)", "-->").getRegex(), Qe = d("^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(), q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Ue = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), de = d(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex(), ke = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex(), Ke = d("reflink|nolink(?!\\()", "g").replace("reflink", de).replace("nolink", ke).getRegex(), se = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, X = { _backpedal: I, anyPunctuation: Ne, autolink: Fe, blockSkip: qe, br: le, code: Ae, del: I, emStrongLDelim: ve, emStrongRDelimAst: He, emStrongRDelimUnd: Ge, escape: ze, link: Ue, nolink: ke, punctuation: Ee, reflink: de, reflinkSearch: Ke, tag: Qe, text: Ie, url: I }, We = { ...X, link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() }, N = { ...X, emStrongRDelimAst: Ze, emStrongLDelim: De, url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", se).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: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", se).getRegex() }, Xe = { ...N, br: d(le).replace("{2,}", "*").getRegex(), text: d(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, C = { normal: K, gfm: Le, pedantic: Me }, M = { normal: X, gfm: N, breaks: Xe, pedantic: We };
|
|
18
|
+
var Je = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, ge = (u3) => Je[u3];
|
|
19
|
+
function w(u3, e) {
|
|
20
20
|
if (e) {
|
|
21
|
-
if (m.escapeTest.test(
|
|
22
|
-
} else if (m.escapeTestNoEncode.test(
|
|
23
|
-
return
|
|
21
|
+
if (m.escapeTest.test(u3)) return u3.replace(m.escapeReplace, ge);
|
|
22
|
+
} else if (m.escapeTestNoEncode.test(u3)) return u3.replace(m.escapeReplaceNoEncode, ge);
|
|
23
|
+
return u3;
|
|
24
24
|
}
|
|
25
|
-
function J(
|
|
25
|
+
function J(u3) {
|
|
26
26
|
try {
|
|
27
|
-
|
|
27
|
+
u3 = encodeURI(u3).replace(m.percentDecode, "%");
|
|
28
28
|
} catch {
|
|
29
29
|
return null;
|
|
30
30
|
}
|
|
31
|
-
return
|
|
31
|
+
return u3;
|
|
32
32
|
}
|
|
33
|
-
function V(
|
|
34
|
-
let t =
|
|
35
|
-
let a = false,
|
|
36
|
-
for (; --
|
|
33
|
+
function V(u3, e) {
|
|
34
|
+
let t = u3.replace(m.findPipe, (i, s, o) => {
|
|
35
|
+
let a = false, l = s;
|
|
36
|
+
for (; --l >= 0 && o[l] === "\\"; ) a = !a;
|
|
37
37
|
return a ? "|" : " |";
|
|
38
38
|
}), n = t.split(m.splitPipe), r = 0;
|
|
39
39
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
|
|
@@ -41,33 +41,33 @@ function V(l3, e) {
|
|
|
41
41
|
for (; r < n.length; r++) n[r] = n[r].trim().replace(m.slashPipe, "|");
|
|
42
42
|
return n;
|
|
43
43
|
}
|
|
44
|
-
function z(
|
|
45
|
-
let n =
|
|
44
|
+
function z(u3, e, t) {
|
|
45
|
+
let n = u3.length;
|
|
46
46
|
if (n === 0) return "";
|
|
47
47
|
let r = 0;
|
|
48
48
|
for (; r < n; ) {
|
|
49
|
-
let i =
|
|
49
|
+
let i = u3.charAt(n - r - 1);
|
|
50
50
|
if (i === e && true) r++;
|
|
51
51
|
else break;
|
|
52
52
|
}
|
|
53
|
-
return
|
|
53
|
+
return u3.slice(0, n - r);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
if (
|
|
55
|
+
function fe(u3, e) {
|
|
56
|
+
if (u3.indexOf(e[1]) === -1) return -1;
|
|
57
57
|
let t = 0;
|
|
58
|
-
for (let n = 0; n <
|
|
59
|
-
else if (
|
|
60
|
-
else if (
|
|
58
|
+
for (let n = 0; n < u3.length; n++) if (u3[n] === "\\") n++;
|
|
59
|
+
else if (u3[n] === e[0]) t++;
|
|
60
|
+
else if (u3[n] === e[1] && (t--, t < 0)) return n;
|
|
61
61
|
return t > 0 ? -2 : -1;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
let i = e.href, s = e.title || null, o =
|
|
63
|
+
function me(u3, e, t, n, r) {
|
|
64
|
+
let i = e.href, s = e.title || null, o = u3[1].replace(r.other.outputLinkReplace, "$1");
|
|
65
65
|
n.state.inLink = true;
|
|
66
|
-
let a = { type:
|
|
66
|
+
let a = { type: u3[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: s, text: o, tokens: n.inlineTokens(o) };
|
|
67
67
|
return n.state.inLink = false, a;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
let n =
|
|
69
|
+
function Ve(u3, e, t) {
|
|
70
|
+
let n = u3.match(t.other.indentCodeCompensation);
|
|
71
71
|
if (n === null) return e;
|
|
72
72
|
let r = n[1];
|
|
73
73
|
return e.split(`
|
|
@@ -84,7 +84,7 @@ var y = class {
|
|
|
84
84
|
rules;
|
|
85
85
|
lexer;
|
|
86
86
|
constructor(e) {
|
|
87
|
-
this.options = e ||
|
|
87
|
+
this.options = e || T;
|
|
88
88
|
}
|
|
89
89
|
space(e) {
|
|
90
90
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -101,7 +101,7 @@ var y = class {
|
|
|
101
101
|
fences(e) {
|
|
102
102
|
let t = this.rules.block.fences.exec(e);
|
|
103
103
|
if (t) {
|
|
104
|
-
let n = t[0], r =
|
|
104
|
+
let n = t[0], r = Ve(n, t[3] || "", this.rules);
|
|
105
105
|
return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: r };
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -128,32 +128,32 @@ var y = class {
|
|
|
128
128
|
`).split(`
|
|
129
129
|
`), r = "", i = "", s = [];
|
|
130
130
|
for (; n.length > 0; ) {
|
|
131
|
-
let o = false, a = [],
|
|
132
|
-
for (
|
|
133
|
-
else if (!o) a.push(n[
|
|
131
|
+
let o = false, a = [], l;
|
|
132
|
+
for (l = 0; l < n.length; l++) if (this.rules.other.blockquoteStart.test(n[l])) a.push(n[l]), o = true;
|
|
133
|
+
else if (!o) a.push(n[l]);
|
|
134
134
|
else break;
|
|
135
|
-
n = n.slice(
|
|
136
|
-
let
|
|
137
|
-
`),
|
|
135
|
+
n = n.slice(l);
|
|
136
|
+
let c = a.join(`
|
|
137
|
+
`), p = c.replace(this.rules.other.blockquoteSetextReplace, `
|
|
138
138
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
139
139
|
r = r ? `${r}
|
|
140
|
-
${
|
|
141
|
-
${
|
|
142
|
-
let
|
|
143
|
-
if (this.lexer.state.top = true, this.lexer.blockTokens(
|
|
144
|
-
let
|
|
145
|
-
if (
|
|
146
|
-
if (
|
|
147
|
-
let
|
|
140
|
+
${c}` : c, i = i ? `${i}
|
|
141
|
+
${p}` : p;
|
|
142
|
+
let g = this.lexer.state.top;
|
|
143
|
+
if (this.lexer.state.top = true, this.lexer.blockTokens(p, s, true), this.lexer.state.top = g, n.length === 0) break;
|
|
144
|
+
let h = s.at(-1);
|
|
145
|
+
if (h?.type === "code") break;
|
|
146
|
+
if (h?.type === "blockquote") {
|
|
147
|
+
let R = h, f = R.raw + `
|
|
148
148
|
` + n.join(`
|
|
149
|
-
`),
|
|
150
|
-
s[s.length - 1] =
|
|
149
|
+
`), O = this.blockquote(f);
|
|
150
|
+
s[s.length - 1] = O, r = r.substring(0, r.length - R.raw.length) + O.raw, i = i.substring(0, i.length - R.text.length) + O.text;
|
|
151
151
|
break;
|
|
152
|
-
} else if (
|
|
153
|
-
let
|
|
152
|
+
} else if (h?.type === "list") {
|
|
153
|
+
let R = h, f = R.raw + `
|
|
154
154
|
` + n.join(`
|
|
155
|
-
`),
|
|
156
|
-
s[s.length - 1] =
|
|
155
|
+
`), O = this.list(f);
|
|
156
|
+
s[s.length - 1] = O, r = r.substring(0, r.length - h.raw.length) + O.raw, i = i.substring(0, i.length - R.raw.length) + O.raw, n = f.substring(s.at(-1).raw.length).split(`
|
|
157
157
|
`);
|
|
158
158
|
continue;
|
|
159
159
|
}
|
|
@@ -168,43 +168,43 @@ ${c}` : c;
|
|
|
168
168
|
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
169
169
|
let s = this.rules.other.listItemRegex(n), o = false;
|
|
170
170
|
for (; e; ) {
|
|
171
|
-
let
|
|
171
|
+
let l = false, c = "", p = "";
|
|
172
172
|
if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
173
|
-
|
|
174
|
-
let
|
|
175
|
-
`, 1)[0].replace(this.rules.other.listReplaceTabs, (H) => " ".repeat(3 * H.length)),
|
|
176
|
-
`, 1)[0],
|
|
177
|
-
if (this.options.pedantic ? (
|
|
178
|
-
`, e = e.substring(
|
|
179
|
-
let H = this.rules.other.nextBulletRegex(
|
|
173
|
+
c = t[0], e = e.substring(c.length);
|
|
174
|
+
let g = t[2].split(`
|
|
175
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, (H) => " ".repeat(3 * H.length)), h = e.split(`
|
|
176
|
+
`, 1)[0], R = !g.trim(), f = 0;
|
|
177
|
+
if (this.options.pedantic ? (f = 2, p = g.trimStart()) : R ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, p = g.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(h) && (c += h + `
|
|
178
|
+
`, e = e.substring(h.length + 1), l = true), !l) {
|
|
179
|
+
let H = this.rules.other.nextBulletRegex(f), ee = this.rules.other.hrRegex(f), te = this.rules.other.fencesBeginRegex(f), ne = this.rules.other.headingBeginRegex(f), xe = this.rules.other.htmlBeginRegex(f);
|
|
180
180
|
for (; e; ) {
|
|
181
181
|
let Z = e.split(`
|
|
182
182
|
`, 1)[0], A;
|
|
183
|
-
if (
|
|
184
|
-
if (A.search(this.rules.other.nonSpaceChar) >=
|
|
185
|
-
` + A.slice(
|
|
183
|
+
if (h = Z, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), A = h) : A = h.replace(this.rules.other.tabCharGlobal, " "), te.test(h) || ne.test(h) || xe.test(h) || H.test(h) || ee.test(h)) break;
|
|
184
|
+
if (A.search(this.rules.other.nonSpaceChar) >= f || !h.trim()) p += `
|
|
185
|
+
` + A.slice(f);
|
|
186
186
|
else {
|
|
187
|
-
if (
|
|
188
|
-
|
|
189
|
-
` +
|
|
187
|
+
if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te.test(g) || ne.test(g) || ee.test(g)) break;
|
|
188
|
+
p += `
|
|
189
|
+
` + h;
|
|
190
190
|
}
|
|
191
|
-
!
|
|
192
|
-
`, e = e.substring(Z.length + 1),
|
|
191
|
+
!R && !h.trim() && (R = true), c += Z + `
|
|
192
|
+
`, e = e.substring(Z.length + 1), g = A.slice(f);
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
i.loose || (o ? i.loose = true : this.rules.other.doubleBlankLine.test(
|
|
196
|
-
let
|
|
197
|
-
this.options.gfm && (
|
|
195
|
+
i.loose || (o ? i.loose = true : this.rules.other.doubleBlankLine.test(c) && (o = true));
|
|
196
|
+
let O = null, Y;
|
|
197
|
+
this.options.gfm && (O = this.rules.other.listIsTask.exec(p), O && (Y = O[0] !== "[ ] ", p = p.replace(this.rules.other.listReplaceTask, ""))), i.items.push({ type: "list_item", raw: c, task: !!O, checked: Y, loose: false, text: p, tokens: [] }), i.raw += c;
|
|
198
198
|
}
|
|
199
199
|
let a = i.items.at(-1);
|
|
200
200
|
if (a) a.raw = a.raw.trimEnd(), a.text = a.text.trimEnd();
|
|
201
201
|
else return;
|
|
202
202
|
i.raw = i.raw.trimEnd();
|
|
203
|
-
for (let
|
|
204
|
-
let
|
|
205
|
-
i.loose =
|
|
203
|
+
for (let l = 0; l < i.items.length; l++) if (this.lexer.state.top = false, i.items[l].tokens = this.lexer.blockTokens(i.items[l].text, []), !i.loose) {
|
|
204
|
+
let c = i.items[l].tokens.filter((g) => g.type === "space"), p = c.length > 0 && c.some((g) => this.rules.other.anyLine.test(g.raw));
|
|
205
|
+
i.loose = p;
|
|
206
206
|
}
|
|
207
|
-
if (i.loose) for (let
|
|
207
|
+
if (i.loose) for (let l = 0; l < i.items.length; l++) i.items[l].loose = true;
|
|
208
208
|
return i;
|
|
209
209
|
}
|
|
210
210
|
}
|
|
@@ -227,7 +227,7 @@ ${c}` : c;
|
|
|
227
227
|
if (n.length === r.length) {
|
|
228
228
|
for (let o of r) this.rules.other.tableAlignRight.test(o) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? s.align.push("left") : s.align.push(null);
|
|
229
229
|
for (let o = 0; o < n.length; o++) s.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: true, align: s.align[o] });
|
|
230
|
-
for (let o of i) s.rows.push(V(o, s.header.length).map((a,
|
|
230
|
+
for (let o of i) s.rows.push(V(o, s.header.length).map((a, l) => ({ text: a, tokens: this.lexer.inline(a), header: false, align: s.align[l] })));
|
|
231
231
|
return s;
|
|
232
232
|
}
|
|
233
233
|
}
|
|
@@ -264,7 +264,7 @@ ${c}` : c;
|
|
|
264
264
|
let s = z(n.slice(0, -1), "\\");
|
|
265
265
|
if ((n.length - s.length) % 2 === 0) return;
|
|
266
266
|
} else {
|
|
267
|
-
let s =
|
|
267
|
+
let s = fe(t[2], "()");
|
|
268
268
|
if (s === -2) return;
|
|
269
269
|
if (s > -1) {
|
|
270
270
|
let a = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
|
|
@@ -276,7 +276,7 @@ ${c}` : c;
|
|
|
276
276
|
let s = this.rules.other.pedanticHrefTitle.exec(r);
|
|
277
277
|
s && (r = s[1], i = s[3]);
|
|
278
278
|
} else i = t[3] ? t[3].slice(1, -1) : "";
|
|
279
|
-
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)),
|
|
279
|
+
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), me(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
reflink(e, t) {
|
|
@@ -287,32 +287,32 @@ ${c}` : c;
|
|
|
287
287
|
let s = n[0].charAt(0);
|
|
288
288
|
return { type: "text", raw: s, text: s };
|
|
289
289
|
}
|
|
290
|
-
return
|
|
290
|
+
return me(n, i, n[0], this.lexer, this.rules);
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
emStrong(e, t, n = "") {
|
|
294
294
|
let r = this.rules.inline.emStrongLDelim.exec(e);
|
|
295
295
|
if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
|
|
296
296
|
if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
297
|
-
let s = [...r[0]].length - 1, o, a,
|
|
298
|
-
for (
|
|
297
|
+
let s = [...r[0]].length - 1, o, a, l = s, c = 0, p = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
298
|
+
for (p.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = p.exec(t)) != null; ) {
|
|
299
299
|
if (o = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !o) continue;
|
|
300
300
|
if (a = [...o].length, r[3] || r[4]) {
|
|
301
|
-
|
|
301
|
+
l += a;
|
|
302
302
|
continue;
|
|
303
303
|
} else if ((r[5] || r[6]) && s % 3 && !((s + a) % 3)) {
|
|
304
|
-
|
|
304
|
+
c += a;
|
|
305
305
|
continue;
|
|
306
306
|
}
|
|
307
|
-
if (
|
|
308
|
-
a = Math.min(a, a +
|
|
309
|
-
let
|
|
307
|
+
if (l -= a, l > 0) continue;
|
|
308
|
+
a = Math.min(a, a + l + c);
|
|
309
|
+
let g = [...r[0]][0].length, h = e.slice(0, s + r.index + g + a);
|
|
310
310
|
if (Math.min(s, a) % 2) {
|
|
311
|
-
let
|
|
312
|
-
return { type: "em", raw:
|
|
311
|
+
let f = h.slice(1, -1);
|
|
312
|
+
return { type: "em", raw: h, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
313
313
|
}
|
|
314
|
-
let
|
|
315
|
-
return { type: "strong", raw:
|
|
314
|
+
let R = h.slice(2, -2);
|
|
315
|
+
return { type: "strong", raw: h, text: R, tokens: this.lexer.inlineTokens(R) };
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}
|
|
@@ -361,25 +361,25 @@ ${c}` : c;
|
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
};
|
|
364
|
-
var
|
|
364
|
+
var x = class u {
|
|
365
365
|
tokens;
|
|
366
366
|
options;
|
|
367
367
|
state;
|
|
368
368
|
tokenizer;
|
|
369
369
|
inlineQueue;
|
|
370
370
|
constructor(e) {
|
|
371
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e ||
|
|
372
|
-
let t = { other: m, block:
|
|
373
|
-
this.options.pedantic ? (t.block =
|
|
371
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new y(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
|
|
372
|
+
let t = { other: m, block: C.normal, inline: M.normal };
|
|
373
|
+
this.options.pedantic ? (t.block = C.pedantic, t.inline = M.pedantic) : this.options.gfm && (t.block = C.gfm, this.options.breaks ? t.inline = M.breaks : t.inline = M.gfm), this.tokenizer.rules = t;
|
|
374
374
|
}
|
|
375
375
|
static get rules() {
|
|
376
|
-
return { block:
|
|
376
|
+
return { block: C, inline: M };
|
|
377
377
|
}
|
|
378
378
|
static lex(e, t) {
|
|
379
|
-
return new
|
|
379
|
+
return new u(t).lex(e);
|
|
380
380
|
}
|
|
381
381
|
static lexInline(e, t) {
|
|
382
|
-
return new
|
|
382
|
+
return new u(t).inlineTokens(e);
|
|
383
383
|
}
|
|
384
384
|
lex(e) {
|
|
385
385
|
e = e.replace(m.carriageReturn, `
|
|
@@ -454,8 +454,8 @@ var b = class l {
|
|
|
454
454
|
let i = e;
|
|
455
455
|
if (this.options.extensions?.startBlock) {
|
|
456
456
|
let s = 1 / 0, o = e.slice(1), a;
|
|
457
|
-
this.options.extensions.startBlock.forEach((
|
|
458
|
-
a =
|
|
457
|
+
this.options.extensions.startBlock.forEach((l) => {
|
|
458
|
+
a = l.call({ lexer: this }, o), typeof a == "number" && a >= 0 && (s = Math.min(s, a));
|
|
459
459
|
}), s < 1 / 0 && s >= 0 && (i = e.substring(0, s + 1));
|
|
460
460
|
}
|
|
461
461
|
if (this.state.top && (r = this.tokenizer.paragraph(i))) {
|
|
@@ -501,7 +501,7 @@ var b = class l {
|
|
|
501
501
|
for (; e; ) {
|
|
502
502
|
i || (s = ""), i = false;
|
|
503
503
|
let o;
|
|
504
|
-
if (this.options.extensions?.inline?.some((
|
|
504
|
+
if (this.options.extensions?.inline?.some((l) => (o = l.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false)) continue;
|
|
505
505
|
if (o = this.tokenizer.escape(e)) {
|
|
506
506
|
e = e.substring(o.raw.length), t.push(o);
|
|
507
507
|
continue;
|
|
@@ -516,8 +516,8 @@ var b = class l {
|
|
|
516
516
|
}
|
|
517
517
|
if (o = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
518
518
|
e = e.substring(o.raw.length);
|
|
519
|
-
let
|
|
520
|
-
o.type === "text" &&
|
|
519
|
+
let l = t.at(-1);
|
|
520
|
+
o.type === "text" && l?.type === "text" ? (l.raw += o.raw, l.text += o.text) : t.push(o);
|
|
521
521
|
continue;
|
|
522
522
|
}
|
|
523
523
|
if (o = this.tokenizer.emStrong(e, n, s)) {
|
|
@@ -546,23 +546,23 @@ var b = class l {
|
|
|
546
546
|
}
|
|
547
547
|
let a = e;
|
|
548
548
|
if (this.options.extensions?.startInline) {
|
|
549
|
-
let
|
|
550
|
-
this.options.extensions.startInline.forEach((
|
|
551
|
-
|
|
552
|
-
}),
|
|
549
|
+
let l = 1 / 0, c = e.slice(1), p;
|
|
550
|
+
this.options.extensions.startInline.forEach((g) => {
|
|
551
|
+
p = g.call({ lexer: this }, c), typeof p == "number" && p >= 0 && (l = Math.min(l, p));
|
|
552
|
+
}), l < 1 / 0 && l >= 0 && (a = e.substring(0, l + 1));
|
|
553
553
|
}
|
|
554
554
|
if (o = this.tokenizer.inlineText(a)) {
|
|
555
555
|
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (s = o.raw.slice(-1)), i = true;
|
|
556
|
-
let
|
|
557
|
-
|
|
556
|
+
let l = t.at(-1);
|
|
557
|
+
l?.type === "text" ? (l.raw += o.raw, l.text += o.text) : t.push(o);
|
|
558
558
|
continue;
|
|
559
559
|
}
|
|
560
560
|
if (e) {
|
|
561
|
-
let
|
|
561
|
+
let l = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
562
562
|
if (this.options.silent) {
|
|
563
|
-
console.error(
|
|
563
|
+
console.error(l);
|
|
564
564
|
break;
|
|
565
|
-
} else throw new Error(
|
|
565
|
+
} else throw new Error(l);
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
return t;
|
|
@@ -572,7 +572,7 @@ var P = class {
|
|
|
572
572
|
options;
|
|
573
573
|
parser;
|
|
574
574
|
constructor(e) {
|
|
575
|
-
this.options = e ||
|
|
575
|
+
this.options = e || T;
|
|
576
576
|
}
|
|
577
577
|
space(e) {
|
|
578
578
|
return "";
|
|
@@ -720,18 +720,18 @@ var $ = class {
|
|
|
720
720
|
return "";
|
|
721
721
|
}
|
|
722
722
|
};
|
|
723
|
-
var
|
|
723
|
+
var b = class u2 {
|
|
724
724
|
options;
|
|
725
725
|
renderer;
|
|
726
726
|
textRenderer;
|
|
727
727
|
constructor(e) {
|
|
728
|
-
this.options = e ||
|
|
728
|
+
this.options = e || T, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
|
|
729
729
|
}
|
|
730
730
|
static parse(e, t) {
|
|
731
|
-
return new
|
|
731
|
+
return new u2(t).parse(e);
|
|
732
732
|
}
|
|
733
733
|
static parseInline(e, t) {
|
|
734
|
-
return new
|
|
734
|
+
return new u2(t).parseInline(e);
|
|
735
735
|
}
|
|
736
736
|
parse(e, t = true) {
|
|
737
737
|
let n = "";
|
|
@@ -869,7 +869,7 @@ var S = class {
|
|
|
869
869
|
options;
|
|
870
870
|
block;
|
|
871
871
|
constructor(e) {
|
|
872
|
-
this.options = e ||
|
|
872
|
+
this.options = e || T;
|
|
873
873
|
}
|
|
874
874
|
static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
|
|
875
875
|
static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
|
|
@@ -886,10 +886,10 @@ var S = class {
|
|
|
886
886
|
return e;
|
|
887
887
|
}
|
|
888
888
|
provideLexer() {
|
|
889
|
-
return this.block ?
|
|
889
|
+
return this.block ? x.lex : x.lexInline;
|
|
890
890
|
}
|
|
891
891
|
provideParser() {
|
|
892
|
-
return this.block ?
|
|
892
|
+
return this.block ? b.parse : b.parseInline;
|
|
893
893
|
}
|
|
894
894
|
};
|
|
895
895
|
var B = class {
|
|
@@ -897,10 +897,10 @@ var B = class {
|
|
|
897
897
|
options = this.setOptions;
|
|
898
898
|
parse = this.parseMarkdown(true);
|
|
899
899
|
parseInline = this.parseMarkdown(false);
|
|
900
|
-
Parser =
|
|
900
|
+
Parser = b;
|
|
901
901
|
Renderer = P;
|
|
902
902
|
TextRenderer = $;
|
|
903
|
-
Lexer =
|
|
903
|
+
Lexer = x;
|
|
904
904
|
Tokenizer = y;
|
|
905
905
|
Hooks = S;
|
|
906
906
|
constructor(...e) {
|
|
@@ -954,10 +954,10 @@ var B = class {
|
|
|
954
954
|
for (let s in n.renderer) {
|
|
955
955
|
if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
|
|
956
956
|
if (["options", "parser"].includes(s)) continue;
|
|
957
|
-
let o = s, a = n.renderer[o],
|
|
958
|
-
i[o] = (...
|
|
959
|
-
let
|
|
960
|
-
return
|
|
957
|
+
let o = s, a = n.renderer[o], l = i[o];
|
|
958
|
+
i[o] = (...c) => {
|
|
959
|
+
let p = a.apply(i, c);
|
|
960
|
+
return p === false && (p = l.apply(i, c)), p || "";
|
|
961
961
|
};
|
|
962
962
|
}
|
|
963
963
|
r.renderer = i;
|
|
@@ -967,10 +967,10 @@ var B = class {
|
|
|
967
967
|
for (let s in n.tokenizer) {
|
|
968
968
|
if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
|
|
969
969
|
if (["options", "rules", "lexer"].includes(s)) continue;
|
|
970
|
-
let o = s, a = n.tokenizer[o],
|
|
971
|
-
i[o] = (...
|
|
972
|
-
let
|
|
973
|
-
return
|
|
970
|
+
let o = s, a = n.tokenizer[o], l = i[o];
|
|
971
|
+
i[o] = (...c) => {
|
|
972
|
+
let p = a.apply(i, c);
|
|
973
|
+
return p === false && (p = l.apply(i, c)), p;
|
|
974
974
|
};
|
|
975
975
|
}
|
|
976
976
|
r.tokenizer = i;
|
|
@@ -980,14 +980,21 @@ var B = class {
|
|
|
980
980
|
for (let s in n.hooks) {
|
|
981
981
|
if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
|
|
982
982
|
if (["options", "block"].includes(s)) continue;
|
|
983
|
-
let o = s, a = n.hooks[o],
|
|
984
|
-
S.passThroughHooks.has(s) ? i[o] = (
|
|
985
|
-
if (this.defaults.async && S.passThroughHooksRespectAsync.has(s)) return
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
let
|
|
990
|
-
return
|
|
983
|
+
let o = s, a = n.hooks[o], l = i[o];
|
|
984
|
+
S.passThroughHooks.has(s) ? i[o] = (c) => {
|
|
985
|
+
if (this.defaults.async && S.passThroughHooksRespectAsync.has(s)) return (async () => {
|
|
986
|
+
let g = await a.call(i, c);
|
|
987
|
+
return l.call(i, g);
|
|
988
|
+
})();
|
|
989
|
+
let p = a.call(i, c);
|
|
990
|
+
return l.call(i, p);
|
|
991
|
+
} : i[o] = (...c) => {
|
|
992
|
+
if (this.defaults.async) return (async () => {
|
|
993
|
+
let g = await a.apply(i, c);
|
|
994
|
+
return g === false && (g = await l.apply(i, c)), g;
|
|
995
|
+
})();
|
|
996
|
+
let p = a.apply(i, c);
|
|
997
|
+
return p === false && (p = l.apply(i, c)), p;
|
|
991
998
|
};
|
|
992
999
|
}
|
|
993
1000
|
r.hooks = i;
|
|
@@ -1006,10 +1013,10 @@ var B = class {
|
|
|
1006
1013
|
return this.defaults = { ...this.defaults, ...e }, this;
|
|
1007
1014
|
}
|
|
1008
1015
|
lexer(e, t) {
|
|
1009
|
-
return
|
|
1016
|
+
return x.lex(e, t ?? this.defaults);
|
|
1010
1017
|
}
|
|
1011
1018
|
parser(e, t) {
|
|
1012
|
-
return
|
|
1019
|
+
return b.parse(e, t ?? this.defaults);
|
|
1013
1020
|
}
|
|
1014
1021
|
parseMarkdown(e) {
|
|
1015
1022
|
return (n, r) => {
|
|
@@ -1017,17 +1024,20 @@ var B = class {
|
|
|
1017
1024
|
if (this.defaults.async === true && i.async === false) return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
1018
1025
|
if (typeof n > "u" || n === null) return o(new Error("marked(): input parameter is undefined or null"));
|
|
1019
1026
|
if (typeof n != "string") return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
|
|
1020
|
-
s.hooks && (s.hooks.options = s, s.hooks.block = e)
|
|
1021
|
-
|
|
1022
|
-
|
|
1027
|
+
if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return (async () => {
|
|
1028
|
+
let a = s.hooks ? await s.hooks.preprocess(n) : n, c = await (s.hooks ? await s.hooks.provideLexer() : e ? x.lex : x.lexInline)(a, s), p = s.hooks ? await s.hooks.processAllTokens(c) : c;
|
|
1029
|
+
s.walkTokens && await Promise.all(this.walkTokens(p, s.walkTokens));
|
|
1030
|
+
let h = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(p, s);
|
|
1031
|
+
return s.hooks ? await s.hooks.postprocess(h) : h;
|
|
1032
|
+
})().catch(o);
|
|
1023
1033
|
try {
|
|
1024
1034
|
s.hooks && (n = s.hooks.preprocess(n));
|
|
1025
|
-
let
|
|
1026
|
-
s.hooks && (
|
|
1027
|
-
let
|
|
1028
|
-
return s.hooks && (
|
|
1029
|
-
} catch (
|
|
1030
|
-
return o(
|
|
1035
|
+
let l = (s.hooks ? s.hooks.provideLexer() : e ? x.lex : x.lexInline)(n, s);
|
|
1036
|
+
s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
|
|
1037
|
+
let p = (s.hooks ? s.hooks.provideParser() : e ? b.parse : b.parseInline)(l, s);
|
|
1038
|
+
return s.hooks && (p = s.hooks.postprocess(p)), p;
|
|
1039
|
+
} catch (a) {
|
|
1040
|
+
return o(a);
|
|
1031
1041
|
}
|
|
1032
1042
|
};
|
|
1033
1043
|
}
|
|
@@ -1044,46 +1054,46 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
1044
1054
|
}
|
|
1045
1055
|
};
|
|
1046
1056
|
var _ = new B();
|
|
1047
|
-
function
|
|
1048
|
-
return _.parse(
|
|
1057
|
+
function k(u3, e) {
|
|
1058
|
+
return _.parse(u3, e);
|
|
1049
1059
|
}
|
|
1050
|
-
|
|
1051
|
-
return _.setOptions(
|
|
1060
|
+
k.options = k.setOptions = function(u3) {
|
|
1061
|
+
return _.setOptions(u3), k.defaults = _.defaults, G(k.defaults), k;
|
|
1052
1062
|
};
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
return _.use(...
|
|
1063
|
+
k.getDefaults = L;
|
|
1064
|
+
k.defaults = T;
|
|
1065
|
+
k.use = function(...u3) {
|
|
1066
|
+
return _.use(...u3), k.defaults = _.defaults, G(k.defaults), k;
|
|
1057
1067
|
};
|
|
1058
|
-
|
|
1059
|
-
return _.walkTokens(
|
|
1068
|
+
k.walkTokens = function(u3, e) {
|
|
1069
|
+
return _.walkTokens(u3, e);
|
|
1060
1070
|
};
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1071
|
+
k.parseInline = _.parseInline;
|
|
1072
|
+
k.Parser = b;
|
|
1073
|
+
k.parser = b.parse;
|
|
1074
|
+
k.Renderer = P;
|
|
1075
|
+
k.TextRenderer = $;
|
|
1076
|
+
k.Lexer = x;
|
|
1077
|
+
k.lexer = x.lex;
|
|
1078
|
+
k.Tokenizer = y;
|
|
1079
|
+
k.Hooks = S;
|
|
1080
|
+
k.parse = k;
|
|
1081
|
+
k.options;
|
|
1082
|
+
k.setOptions;
|
|
1083
|
+
k.use;
|
|
1084
|
+
k.walkTokens;
|
|
1085
|
+
k.parseInline;
|
|
1086
|
+
b.parse;
|
|
1087
|
+
x.lex;
|
|
1078
1088
|
export {
|
|
1079
1089
|
S as Hooks,
|
|
1080
|
-
|
|
1090
|
+
x as Lexer,
|
|
1081
1091
|
B as Marked,
|
|
1082
|
-
|
|
1092
|
+
b as Parser,
|
|
1083
1093
|
P as Renderer,
|
|
1084
1094
|
$ as TextRenderer,
|
|
1085
1095
|
y as Tokenizer,
|
|
1086
|
-
|
|
1096
|
+
T as defaults,
|
|
1087
1097
|
L as getDefaults,
|
|
1088
|
-
|
|
1098
|
+
k as marked
|
|
1089
1099
|
};
|