@elmethis/vue 0.1.0 → 0.2.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.
@@ -3,7 +3,7 @@
3
3
  try {
4
4
  if (typeof document != "undefined") {
5
5
  var elementStyle = document.createElement("style");
6
- elementStyle.appendChild(document.createTextNode(".v-enter-to[data-v-0f62a398],.v-leave-from[data-v-0f62a398]{opacity:1}.v-enter-active[data-v-0f62a398],.v-leave-active[data-v-0f62a398]{transition:opacity .15s}.v-enter-from[data-v-0f62a398],.v-leave-to[data-v-0f62a398]{opacity:0}"));
6
+ elementStyle.appendChild(document.createTextNode(".v-enter-to[data-v-a74967e7],.v-leave-from[data-v-a74967e7]{opacity:1}.v-enter-active[data-v-a74967e7],.v-leave-active[data-v-a74967e7]{transition:opacity .15s}.v-enter-from[data-v-a74967e7],.v-leave-to[data-v-a74967e7]{opacity:0}"));
7
7
  document.head.appendChild(elementStyle);
8
8
  }
9
9
  } catch (e) {
@@ -17,7 +17,7 @@ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
17
17
  const cssModules = {
18
18
  "$style": style0
19
19
  };
20
- const ElmCodeBlock = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules], ["__scopeId", "data-v-0f62a398"]]);
20
+ const ElmCodeBlock = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules], ["__scopeId", "data-v-a74967e7"]]);
21
21
  export {
22
22
  ElmCodeBlock as default
23
23
  };
@@ -28,14 +28,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
28
28
  }, [
29
29
  (openBlock(true), createElementBlock(Fragment, null, renderList(computedProgress.value, (p) => {
30
30
  return openBlock(), createElementBlock("div", {
31
- key: _ctx.index,
32
31
  class: normalizeClass(_ctx.$style.bar),
33
32
  style: normalizeStyle({
34
33
  "--transform": `translateX(${p.start}%) scaleX(${p.scale})`,
35
34
  "--color": p.color
36
35
  })
37
36
  }, null, 6);
38
- }), 128))
37
+ }), 256))
39
38
  ], 6);
40
39
  };
41
40
  }
@@ -11,7 +11,7 @@
11
11
  }
12
12
  })();
13
13
  import { defineComponent, ref, computed, watch, createElementBlock, openBlock, Fragment, renderList, createBlock, resolveDynamicComponent, h } from "vue";
14
- import { marked as k } from "../../node_modules/.pnpm/marked@16.4.1/node_modules/marked/lib/marked.esm.mjs";
14
+ import { marked as d } from "../../node_modules/.pnpm/marked@17.0.1/node_modules/marked/lib/marked.esm.mjs";
15
15
  import ElmInlineText from "../typography/ElmInlineText.vue.mjs";
16
16
  import ElmHeading from "../typography/ElmHeading.vue.mjs";
17
17
  import ElmParagraph from "../typography/ElmParagraph.vue.mjs";
@@ -228,7 +228,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
228
228
  return results;
229
229
  };
230
230
  const renderMarkdown = ({ markdown }) => {
231
- const tokens = k.setOptions({ gfm: true }).lexer(markdown);
231
+ const tokens = d.setOptions({ gfm: true }).lexer(markdown);
232
232
  return renderByToken({ tokens });
233
233
  };
234
234
  const renderResult = ref(renderMarkdown({ markdown: props.markdown }));
@@ -2,27 +2,33 @@ 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
4
  var T = L();
5
- function G(u3) {
5
+ function Z(u3) {
6
6
  T = u3;
7
7
  }
8
- var I = { exec: () => null };
9
- function h(u3, e = "") {
8
+ var C = { exec: () => null };
9
+ function k(u3, e = "") {
10
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: (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 = h(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 = h(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 = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Se = h(/^( {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 = h("^ {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 = h(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 = h(/^( {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 = h("^ *([^\\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: h(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: h(`^ *(?: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: h(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 = h(/^((?![*_])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 = h(/link|code|html/, "g").replace("link", new RegExp("\\[(?:[^\\[\\]`]|(?<!`)(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)")).replace("code", new RegExp("(?<!`)(?<b>`+)[^`]+\\k<b>(?!`)")).replace("html", /<(?! )[^<>]*?>/).getRegex(), ce = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, ve = h(ce, "u").replace(/punct/g, D).getRegex(), De = h(ce, "u").replace(/punct/g, pe).getRegex(), he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", He = h(he, "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(), Ze = h(he, "gu").replace(/notPunctSpace/g, Be).replace(/punctSpace/g, Ce).replace(/punct/g, pe).getRegex(), Ge = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)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 = h(/\\(punct)/, "gu").replace(/punct/g, D).getRegex(), Fe = h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), je = h(U).replace("(?:-->|$)", "-->").getRegex(), Qe = h("^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 = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), de = h(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex(), ke = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex(), Ke = h("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: h(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() }, N = { ...X, emStrongRDelimAst: Ze, emStrongLDelim: De, url: h(/^((?: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: h(/^([`~]+|[^`~])(?:(?= {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: h(le).replace("{2,}", "*").getRegex(), text: h(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 = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, ge = (u3) => Je[u3];
16
+ var me = (() => {
17
+ try {
18
+ return !!new RegExp("(?<=1)(?<!1)");
19
+ } catch {
20
+ return false;
21
+ }
22
+ })(), 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]\] +\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: (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") }, xe = /^(?:[ \t]*(?:\n|$))+/, be = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Re = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Te = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, N = /(?:[*+-]|\d{1,9}[.)])/, re = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, se = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Oe = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Q = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, we = /^[^\n]+/, F = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, ye = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", F).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Pe = k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, N).getRegex(), v = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", j = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Se = k("^ {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", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ie = k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), $e = k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ie).getRegex(), U = { blockquote: $e, code: be, def: ye, fences: Re, heading: Te, hr: I, html: Se, lheading: se, list: Pe, newline: xe, paragraph: ie, table: C, text: we }, te = k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), _e = { ...U, lheading: Oe, table: te, paragraph: k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", te).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() }, Le = { ...U, html: k(`^ *(?: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: C, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: k(Q).replace("hr", I).replace("heading", ` *#{1,6} *[^
23
+ ]`).replace("lheading", se).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Me = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ze = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, oe = /^( {2,}|\\)\n(?!\s*$)/, Ae = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, D = /[\p{P}\p{S}]/u, K = /[\s\p{P}\p{S}]/u, ae = /[^\s\p{P}\p{S}]/u, Ce = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, K).getRegex(), le = /(?!~)[\p{P}\p{S}]/u, Ie = /(?!~)[\s\p{P}\p{S}]/u, Ee = /(?:[^\s\p{P}\p{S}]|~)/u, Be = k(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", me ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ue = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, qe = k(ue, "u").replace(/punct/g, D).getRegex(), ve = k(ue, "u").replace(/punct/g, le).getRegex(), pe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", De = k(pe, "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, D).getRegex(), He = k(pe, "gu").replace(/notPunctSpace/g, Ee).replace(/punctSpace/g, Ie).replace(/punct/g, le).getRegex(), Ze = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, D).getRegex(), Ge = k(/\\(punct)/, "gu").replace(/punct/g, D).getRegex(), Ne = k(/^<(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(), Qe = k(j).replace("(?:-->|$)", "-->").getRegex(), Fe = k("^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", Qe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, je = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ce = k(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", F).getRegex(), he = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", F).getRegex(), Ue = k("reflink|nolink(?!\\()", "g").replace("reflink", ce).replace("nolink", he).getRegex(), ne = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, W = { _backpedal: C, anyPunctuation: Ge, autolink: Ne, blockSkip: Be, br: oe, code: ze, del: C, emStrongLDelim: qe, emStrongRDelimAst: De, emStrongRDelimUnd: Ze, escape: Me, link: je, nolink: he, punctuation: Ce, reflink: ce, reflinkSearch: Ue, tag: Fe, text: Ae, url: C }, Ke = { ...W, link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() }, G = { ...W, emStrongRDelimAst: He, emStrongLDelim: ve, url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ne).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: k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ne).getRegex() }, We = { ...G, br: k(oe).replace("{2,}", "*").getRegex(), text: k(G.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, E = { normal: U, gfm: _e, pedantic: Le }, M = { normal: W, gfm: G, breaks: We, pedantic: Ke };
24
+ var Xe = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, ke = (u3) => Xe[u3];
19
25
  function w(u3, e) {
20
26
  if (e) {
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);
27
+ if (m.escapeTest.test(u3)) return u3.replace(m.escapeReplace, ke);
28
+ } else if (m.escapeTestNoEncode.test(u3)) return u3.replace(m.escapeReplaceNoEncode, ke);
23
29
  return u3;
24
30
  }
25
- function J(u3) {
31
+ function X(u3) {
26
32
  try {
27
33
  u3 = encodeURI(u3).replace(m.percentDecode, "%");
28
34
  } catch {
@@ -30,11 +36,11 @@ function J(u3) {
30
36
  }
31
37
  return u3;
32
38
  }
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
- return a ? "|" : " |";
39
+ function J(u3, e) {
40
+ let t = u3.replace(m.findPipe, (i, s, a) => {
41
+ let o = false, l = s;
42
+ for (; --l >= 0 && a[l] === "\\"; ) o = !o;
43
+ return o ? "|" : " |";
38
44
  }), n = t.split(m.splitPipe), r = 0;
39
45
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
40
46
  else for (; n.length < e; ) n.push("");
@@ -52,7 +58,7 @@ function z(u3, e, t) {
52
58
  }
53
59
  return u3.slice(0, n - r);
54
60
  }
55
- function fe(u3, e) {
61
+ function de(u3, e) {
56
62
  if (u3.indexOf(e[1]) === -1) return -1;
57
63
  let t = 0;
58
64
  for (let n = 0; n < u3.length; n++) if (u3[n] === "\\") n++;
@@ -60,13 +66,13 @@ function fe(u3, e) {
60
66
  else if (u3[n] === e[1] && (t--, t < 0)) return n;
61
67
  return t > 0 ? -2 : -1;
62
68
  }
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");
69
+ function ge(u3, e, t, n, r) {
70
+ let i = e.href, s = e.title || null, a = u3[1].replace(r.other.outputLinkReplace, "$1");
65
71
  n.state.inLink = true;
66
- let a = { type: u3[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: s, text: o, tokens: n.inlineTokens(o) };
67
- return n.state.inLink = false, a;
72
+ let o = { type: u3[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: s, text: a, tokens: n.inlineTokens(a) };
73
+ return n.state.inLink = false, o;
68
74
  }
69
- function Ve(u3, e, t) {
75
+ function Je(u3, e, t) {
70
76
  let n = u3.match(t.other.indentCodeCompensation);
71
77
  if (n === null) return e;
72
78
  let r = n[1];
@@ -74,8 +80,8 @@ function Ve(u3, e, t) {
74
80
  `).map((i) => {
75
81
  let s = i.match(t.other.beginningSpace);
76
82
  if (s === null) return i;
77
- let [o] = s;
78
- return o.length >= r.length ? i.slice(r.length) : i;
83
+ let [a] = s;
84
+ return a.length >= r.length ? i.slice(r.length) : i;
79
85
  }).join(`
80
86
  `);
81
87
  }
@@ -101,7 +107,7 @@ var y = class {
101
107
  fences(e) {
102
108
  let t = this.rules.block.fences.exec(e);
103
109
  if (t) {
104
- let n = t[0], r = Ve(n, t[3] || "", this.rules);
110
+ let n = t[0], r = Je(n, t[3] || "", this.rules);
105
111
  return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: r };
106
112
  }
107
113
  }
@@ -128,32 +134,32 @@ var y = class {
128
134
  `).split(`
129
135
  `), r = "", i = "", s = [];
130
136
  for (; n.length > 0; ) {
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]);
137
+ let a = false, o = [], l;
138
+ for (l = 0; l < n.length; l++) if (this.rules.other.blockquoteStart.test(n[l])) o.push(n[l]), a = true;
139
+ else if (!a) o.push(n[l]);
134
140
  else break;
135
141
  n = n.slice(l);
136
- let c = a.join(`
137
- `), p = c.replace(this.rules.other.blockquoteSetextReplace, `
142
+ let p = o.join(`
143
+ `), c = p.replace(this.rules.other.blockquoteSetextReplace, `
138
144
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
139
145
  r = r ? `${r}
140
- ${c}` : c, i = i ? `${i}
141
- ${p}` : p;
146
+ ${p}` : p, i = i ? `${i}
147
+ ${c}` : c;
142
148
  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 d = s.at(-1);
145
- if (d?.type === "code") break;
146
- if (d?.type === "blockquote") {
147
- let R = d, f = R.raw + `
149
+ if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top = g, n.length === 0) break;
150
+ let h = s.at(-1);
151
+ if (h?.type === "code") break;
152
+ if (h?.type === "blockquote") {
153
+ let R = h, f = R.raw + `
148
154
  ` + n.join(`
149
155
  `), O = this.blockquote(f);
150
156
  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
157
  break;
152
- } else if (d?.type === "list") {
153
- let R = d, f = R.raw + `
158
+ } else if (h?.type === "list") {
159
+ let R = h, f = R.raw + `
154
160
  ` + n.join(`
155
161
  `), O = this.list(f);
156
- s[s.length - 1] = O, r = r.substring(0, r.length - d.raw.length) + O.raw, i = i.substring(0, i.length - R.raw.length) + O.raw, n = f.substring(s.at(-1).raw.length).split(`
162
+ 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
163
  `);
158
164
  continue;
159
165
  }
@@ -166,45 +172,62 @@ ${p}` : p;
166
172
  if (t) {
167
173
  let n = t[1].trim(), r = n.length > 1, i = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: false, items: [] };
168
174
  n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
169
- let s = this.rules.other.listItemRegex(n), o = false;
175
+ let s = this.rules.other.listItemRegex(n), a = false;
170
176
  for (; e; ) {
171
- let l = false, c = "", p = "";
177
+ let l = false, p = "", c = "";
172
178
  if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
173
- c = t[0], e = e.substring(c.length);
179
+ p = t[0], e = e.substring(p.length);
174
180
  let g = t[2].split(`
175
- `, 1)[0].replace(this.rules.other.listReplaceTabs, (H) => " ".repeat(3 * H.length)), d = e.split(`
181
+ `, 1)[0].replace(this.rules.other.listReplaceTabs, (O) => " ".repeat(3 * O.length)), h = e.split(`
176
182
  `, 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(d) && (c += d + `
178
- `, e = e.substring(d.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);
183
+ if (this.options.pedantic ? (f = 2, c = g.trimStart()) : R ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = g.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(h) && (p += h + `
184
+ `, e = e.substring(h.length + 1), l = true), !l) {
185
+ let O = this.rules.other.nextBulletRegex(f), V = this.rules.other.hrRegex(f), Y = this.rules.other.fencesBeginRegex(f), ee = this.rules.other.headingBeginRegex(f), fe = this.rules.other.htmlBeginRegex(f);
180
186
  for (; e; ) {
181
- let Z = e.split(`
187
+ let H = e.split(`
182
188
  `, 1)[0], A;
183
- if (d = Z, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "), A = d) : A = d.replace(this.rules.other.tabCharGlobal, " "), te.test(d) || ne.test(d) || xe.test(d) || H.test(d) || ee.test(d)) break;
184
- if (A.search(this.rules.other.nonSpaceChar) >= f || !d.trim()) p += `
189
+ if (h = H, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), A = h) : A = h.replace(this.rules.other.tabCharGlobal, " "), Y.test(h) || ee.test(h) || fe.test(h) || O.test(h) || V.test(h)) break;
190
+ if (A.search(this.rules.other.nonSpaceChar) >= f || !h.trim()) c += `
185
191
  ` + A.slice(f);
186
192
  else {
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
- ` + d;
193
+ if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || Y.test(g) || ee.test(g) || V.test(g)) break;
194
+ c += `
195
+ ` + h;
190
196
  }
191
- !R && !d.trim() && (R = true), c += Z + `
192
- `, e = e.substring(Z.length + 1), g = A.slice(f);
197
+ !R && !h.trim() && (R = true), p += H + `
198
+ `, e = e.substring(H.length + 1), g = A.slice(f);
193
199
  }
194
200
  }
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;
201
+ i.loose || (a ? i.loose = true : this.rules.other.doubleBlankLine.test(p) && (a = true)), i.items.push({ type: "list_item", raw: p, task: !!this.options.gfm && this.rules.other.listIsTask.test(c), loose: false, text: c, tokens: [] }), i.raw += p;
198
202
  }
199
- let a = i.items.at(-1);
200
- if (a) a.raw = a.raw.trimEnd(), a.text = a.text.trimEnd();
203
+ let o = i.items.at(-1);
204
+ if (o) o.raw = o.raw.trimEnd(), o.text = o.text.trimEnd();
201
205
  else return;
202
206
  i.raw = i.raw.trimEnd();
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;
207
+ for (let l of i.items) {
208
+ if (this.lexer.state.top = false, l.tokens = this.lexer.blockTokens(l.text, []), l.task) {
209
+ if (l.text = l.text.replace(this.rules.other.listReplaceTask, ""), l.tokens[0]?.type === "text" || l.tokens[0]?.type === "paragraph") {
210
+ l.tokens[0].raw = l.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), l.tokens[0].text = l.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
211
+ for (let c = this.lexer.inlineQueue.length - 1; c >= 0; c--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)) {
212
+ this.lexer.inlineQueue[c].src = this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask, "");
213
+ break;
214
+ }
215
+ }
216
+ let p = this.rules.other.listTaskCheckbox.exec(l.raw);
217
+ if (p) {
218
+ let c = { type: "checkbox", raw: p[0] + " ", checked: p[0] !== "[ ]" };
219
+ l.checked = c.checked, i.loose ? l.tokens[0] && ["paragraph", "text"].includes(l.tokens[0].type) && "tokens" in l.tokens[0] && l.tokens[0].tokens ? (l.tokens[0].raw = c.raw + l.tokens[0].raw, l.tokens[0].text = c.raw + l.tokens[0].text, l.tokens[0].tokens.unshift(c)) : l.tokens.unshift({ type: "paragraph", raw: c.raw, text: c.raw, tokens: [c] }) : l.tokens.unshift(c);
220
+ }
221
+ }
222
+ if (!i.loose) {
223
+ let p = l.tokens.filter((g) => g.type === "space"), c = p.length > 0 && p.some((g) => this.rules.other.anyLine.test(g.raw));
224
+ i.loose = c;
225
+ }
226
+ }
227
+ if (i.loose) for (let l of i.items) {
228
+ l.loose = true;
229
+ for (let p of l.tokens) p.type === "text" && (p.type = "paragraph");
206
230
  }
207
- if (i.loose) for (let l = 0; l < i.items.length; l++) i.items[l].loose = true;
208
231
  return i;
209
232
  }
210
233
  }
@@ -222,12 +245,12 @@ ${p}` : p;
222
245
  table(e) {
223
246
  let t = this.rules.block.table.exec(e);
224
247
  if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
225
- let n = V(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
248
+ let n = J(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
226
249
  `) : [], s = { type: "table", raw: t[0], header: [], align: [], rows: [] };
227
250
  if (n.length === r.length) {
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
- 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, l) => ({ text: a, tokens: this.lexer.inline(a), header: false, align: s.align[l] })));
251
+ for (let a of r) this.rules.other.tableAlignRight.test(a) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(a) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(a) ? s.align.push("left") : s.align.push(null);
252
+ for (let a = 0; a < n.length; a++) s.header.push({ text: n[a], tokens: this.lexer.inline(n[a]), header: true, align: s.align[a] });
253
+ for (let a of i) s.rows.push(J(a, s.header.length).map((o, l) => ({ text: o, tokens: this.lexer.inline(o), header: false, align: s.align[l] })));
231
254
  return s;
232
255
  }
233
256
  }
@@ -264,11 +287,11 @@ ${p}` : p;
264
287
  let s = z(n.slice(0, -1), "\\");
265
288
  if ((n.length - s.length) % 2 === 0) return;
266
289
  } else {
267
- let s = fe(t[2], "()");
290
+ let s = de(t[2], "()");
268
291
  if (s === -2) return;
269
292
  if (s > -1) {
270
- let a = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
271
- t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, a).trim(), t[3] = "";
293
+ let o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
294
+ t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, o).trim(), t[3] = "";
272
295
  }
273
296
  }
274
297
  let r = t[2], i = "";
@@ -276,7 +299,7 @@ ${p}` : p;
276
299
  let s = this.rules.other.pedanticHrefTitle.exec(r);
277
300
  s && (r = s[1], i = s[3]);
278
301
  } 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)), 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);
302
+ 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)), ge(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
303
  }
281
304
  }
282
305
  reflink(e, t) {
@@ -287,32 +310,32 @@ ${p}` : p;
287
310
  let s = n[0].charAt(0);
288
311
  return { type: "text", raw: s, text: s };
289
312
  }
290
- return me(n, i, n[0], this.lexer, this.rules);
313
+ return ge(n, i, n[0], this.lexer, this.rules);
291
314
  }
292
315
  }
293
316
  emStrong(e, t, n = "") {
294
317
  let r = this.rules.inline.emStrongLDelim.exec(e);
295
318
  if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
296
319
  if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
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
- if (o = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !o) continue;
300
- if (a = [...o].length, r[3] || r[4]) {
301
- l += a;
320
+ let s = [...r[0]].length - 1, a, o, l = s, p = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
321
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = c.exec(t)) != null; ) {
322
+ if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a) continue;
323
+ if (o = [...a].length, r[3] || r[4]) {
324
+ l += o;
302
325
  continue;
303
- } else if ((r[5] || r[6]) && s % 3 && !((s + a) % 3)) {
304
- c += a;
326
+ } else if ((r[5] || r[6]) && s % 3 && !((s + o) % 3)) {
327
+ p += o;
305
328
  continue;
306
329
  }
307
- if (l -= a, l > 0) continue;
308
- a = Math.min(a, a + l + c);
309
- let g = [...r[0]][0].length, d = e.slice(0, s + r.index + g + a);
310
- if (Math.min(s, a) % 2) {
311
- let f = d.slice(1, -1);
312
- return { type: "em", raw: d, text: f, tokens: this.lexer.inlineTokens(f) };
330
+ if (l -= o, l > 0) continue;
331
+ o = Math.min(o, o + l + p);
332
+ let g = [...r[0]][0].length, h = e.slice(0, s + r.index + g + o);
333
+ if (Math.min(s, o) % 2) {
334
+ let f = h.slice(1, -1);
335
+ return { type: "em", raw: h, text: f, tokens: this.lexer.inlineTokens(f) };
313
336
  }
314
- let R = d.slice(2, -2);
315
- return { type: "strong", raw: d, text: R, tokens: this.lexer.inlineTokens(R) };
337
+ let R = h.slice(2, -2);
338
+ return { type: "strong", raw: h, text: R, tokens: this.lexer.inlineTokens(R) };
316
339
  }
317
340
  }
318
341
  }
@@ -365,15 +388,15 @@ var x = class u {
365
388
  tokens;
366
389
  options;
367
390
  state;
368
- tokenizer;
369
391
  inlineQueue;
392
+ tokenizer;
370
393
  constructor(e) {
371
394
  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;
395
+ let t = { other: m, block: E.normal, inline: M.normal };
396
+ this.options.pedantic ? (t.block = E.pedantic, t.inline = M.pedantic) : this.options.gfm && (t.block = E.gfm, this.options.breaks ? t.inline = M.breaks : t.inline = M.gfm), this.tokenizer.rules = t;
374
397
  }
375
398
  static get rules() {
376
- return { block: C, inline: M };
399
+ return { block: E, inline: M };
377
400
  }
378
401
  static lex(e, t) {
379
402
  return new u(t).lex(e);
@@ -453,9 +476,9 @@ var x = class u {
453
476
  }
454
477
  let i = e;
455
478
  if (this.options.extensions?.startBlock) {
456
- let s = 1 / 0, o = e.slice(1), a;
479
+ let s = 1 / 0, a = e.slice(1), o;
457
480
  this.options.extensions.startBlock.forEach((l) => {
458
- a = l.call({ lexer: this }, o), typeof a == "number" && a >= 0 && (s = Math.min(s, a));
481
+ o = l.call({ lexer: this }, a), typeof o == "number" && o >= 0 && (s = Math.min(s, o));
459
482
  }), s < 1 / 0 && s >= 0 && (i = e.substring(0, s + 1));
460
483
  }
461
484
  if (this.state.top && (r = this.tokenizer.paragraph(i))) {
@@ -495,13 +518,14 @@ var x = class u {
495
518
  if (o.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null; ) o.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
496
519
  }
497
520
  for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null; ) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
498
- for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null; ) n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
521
+ let i;
522
+ for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null; ) i = r[2] ? r[2].length : 0, n = n.slice(0, r.index + i) + "[" + "a".repeat(r[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
499
523
  n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
500
- let i = false, s = "";
524
+ let s = false, a = "";
501
525
  for (; e; ) {
502
- i || (s = ""), i = false;
526
+ s || (a = ""), s = false;
503
527
  let o;
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;
528
+ if (this.options.extensions?.inline?.some((p) => (o = p.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false)) continue;
505
529
  if (o = this.tokenizer.escape(e)) {
506
530
  e = e.substring(o.raw.length), t.push(o);
507
531
  continue;
@@ -516,11 +540,11 @@ var x = class u {
516
540
  }
517
541
  if (o = this.tokenizer.reflink(e, this.tokens.links)) {
518
542
  e = e.substring(o.raw.length);
519
- let l = t.at(-1);
520
- o.type === "text" && l?.type === "text" ? (l.raw += o.raw, l.text += o.text) : t.push(o);
543
+ let p = t.at(-1);
544
+ o.type === "text" && p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : t.push(o);
521
545
  continue;
522
546
  }
523
- if (o = this.tokenizer.emStrong(e, n, s)) {
547
+ if (o = this.tokenizer.emStrong(e, n, a)) {
524
548
  e = e.substring(o.raw.length), t.push(o);
525
549
  continue;
526
550
  }
@@ -544,25 +568,25 @@ var x = class u {
544
568
  e = e.substring(o.raw.length), t.push(o);
545
569
  continue;
546
570
  }
547
- let a = e;
571
+ let l = e;
548
572
  if (this.options.extensions?.startInline) {
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));
573
+ let p = 1 / 0, c = e.slice(1), g;
574
+ this.options.extensions.startInline.forEach((h) => {
575
+ g = h.call({ lexer: this }, c), typeof g == "number" && g >= 0 && (p = Math.min(p, g));
576
+ }), p < 1 / 0 && p >= 0 && (l = e.substring(0, p + 1));
553
577
  }
554
- if (o = this.tokenizer.inlineText(a)) {
555
- e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (s = o.raw.slice(-1)), i = true;
556
- let l = t.at(-1);
557
- l?.type === "text" ? (l.raw += o.raw, l.text += o.text) : t.push(o);
578
+ if (o = this.tokenizer.inlineText(l)) {
579
+ e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (a = o.raw.slice(-1)), s = true;
580
+ let p = t.at(-1);
581
+ p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : t.push(o);
558
582
  continue;
559
583
  }
560
584
  if (e) {
561
- let l = "Infinite loop on byte: " + e.charCodeAt(0);
585
+ let p = "Infinite loop on byte: " + e.charCodeAt(0);
562
586
  if (this.options.silent) {
563
- console.error(l);
587
+ console.error(p);
564
588
  break;
565
- } else throw new Error(l);
589
+ } else throw new Error(p);
566
590
  }
567
591
  }
568
592
  return t;
@@ -605,9 +629,9 @@ ${this.parser.parse(e)}</blockquote>
605
629
  }
606
630
  list(e) {
607
631
  let t = e.ordered, n = e.start, r = "";
608
- for (let o = 0; o < e.items.length; o++) {
609
- let a = e.items[o];
610
- r += this.listitem(a);
632
+ for (let a = 0; a < e.items.length; a++) {
633
+ let o = e.items[a];
634
+ r += this.listitem(o);
611
635
  }
612
636
  let i = t ? "ol" : "ul", s = t && n !== 1 ? ' start="' + n + '"' : "";
613
637
  return "<" + i + s + `>
@@ -615,16 +639,11 @@ ${this.parser.parse(e)}</blockquote>
615
639
  `;
616
640
  }
617
641
  listitem(e) {
618
- let t = "";
619
- if (e.task) {
620
- let n = this.checkbox({ checked: !!e.checked });
621
- e.loose ? e.tokens[0]?.type === "paragraph" ? (e.tokens[0].text = n + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = n + " " + w(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = true)) : e.tokens.unshift({ type: "text", raw: n + " ", text: n + " ", escaped: true }) : t += n + " ";
622
- }
623
- return t += this.parser.parse(e.tokens, !!e.loose), `<li>${t}</li>
642
+ return `<li>${this.parser.parse(e.tokens)}</li>
624
643
  `;
625
644
  }
626
645
  checkbox({ checked: e }) {
627
- return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
646
+ return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
628
647
  }
629
648
  paragraph({ tokens: e }) {
630
649
  return `<p>${this.parser.parseInline(e)}</p>
@@ -638,7 +657,7 @@ ${this.parser.parse(e)}</blockquote>
638
657
  for (let i = 0; i < e.rows.length; i++) {
639
658
  let s = e.rows[i];
640
659
  n = "";
641
- for (let o = 0; o < s.length; o++) n += this.tablecell(s[o]);
660
+ for (let a = 0; a < s.length; a++) n += this.tablecell(s[a]);
642
661
  r += this.tablerow({ text: n });
643
662
  }
644
663
  return r && (r = `<tbody>${r}</tbody>`), `<table>
@@ -673,7 +692,7 @@ ${e}</tr>
673
692
  return `<del>${this.parser.parseInline(e)}</del>`;
674
693
  }
675
694
  link({ href: e, title: t, tokens: n }) {
676
- let r = this.parser.parseInline(n), i = J(e);
695
+ let r = this.parser.parseInline(n), i = X(e);
677
696
  if (i === null) return r;
678
697
  e = i;
679
698
  let s = '<a href="' + e + '"';
@@ -681,7 +700,7 @@ ${e}</tr>
681
700
  }
682
701
  image({ href: e, title: t, text: n, tokens: r }) {
683
702
  r && (n = this.parser.parseInline(r, this.parser.textRenderer));
684
- let i = J(e);
703
+ let i = X(e);
685
704
  if (i === null) return w(n);
686
705
  e = i;
687
706
  let s = `<img src="${e}" alt="${n}"`;
@@ -719,6 +738,9 @@ var $ = class {
719
738
  br() {
720
739
  return "";
721
740
  }
741
+ checkbox({ raw: e }) {
742
+ return e;
743
+ }
722
744
  };
723
745
  var b = class u2 {
724
746
  options;
@@ -733,83 +755,84 @@ var b = class u2 {
733
755
  static parseInline(e, t) {
734
756
  return new u2(t).parseInline(e);
735
757
  }
736
- parse(e, t = true) {
737
- let n = "";
738
- for (let r = 0; r < e.length; r++) {
739
- let i = e[r];
740
- if (this.options.extensions?.renderers?.[i.type]) {
741
- let o = i, a = this.options.extensions.renderers[o.type].call({ parser: this }, o);
742
- if (a !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(o.type)) {
743
- n += a || "";
758
+ parse(e) {
759
+ let t = "";
760
+ for (let n = 0; n < e.length; n++) {
761
+ let r = e[n];
762
+ if (this.options.extensions?.renderers?.[r.type]) {
763
+ let s = r, a = this.options.extensions.renderers[s.type].call({ parser: this }, s);
764
+ if (a !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(s.type)) {
765
+ t += a || "";
744
766
  continue;
745
767
  }
746
768
  }
747
- let s = i;
748
- switch (s.type) {
769
+ let i = r;
770
+ switch (i.type) {
749
771
  case "space": {
750
- n += this.renderer.space(s);
751
- continue;
772
+ t += this.renderer.space(i);
773
+ break;
752
774
  }
753
775
  case "hr": {
754
- n += this.renderer.hr(s);
755
- continue;
776
+ t += this.renderer.hr(i);
777
+ break;
756
778
  }
757
779
  case "heading": {
758
- n += this.renderer.heading(s);
759
- continue;
780
+ t += this.renderer.heading(i);
781
+ break;
760
782
  }
761
783
  case "code": {
762
- n += this.renderer.code(s);
763
- continue;
784
+ t += this.renderer.code(i);
785
+ break;
764
786
  }
765
787
  case "table": {
766
- n += this.renderer.table(s);
767
- continue;
788
+ t += this.renderer.table(i);
789
+ break;
768
790
  }
769
791
  case "blockquote": {
770
- n += this.renderer.blockquote(s);
771
- continue;
792
+ t += this.renderer.blockquote(i);
793
+ break;
772
794
  }
773
795
  case "list": {
774
- n += this.renderer.list(s);
775
- continue;
796
+ t += this.renderer.list(i);
797
+ break;
798
+ }
799
+ case "checkbox": {
800
+ t += this.renderer.checkbox(i);
801
+ break;
776
802
  }
777
803
  case "html": {
778
- n += this.renderer.html(s);
779
- continue;
804
+ t += this.renderer.html(i);
805
+ break;
780
806
  }
781
807
  case "def": {
782
- n += this.renderer.def(s);
783
- continue;
808
+ t += this.renderer.def(i);
809
+ break;
784
810
  }
785
811
  case "paragraph": {
786
- n += this.renderer.paragraph(s);
787
- continue;
812
+ t += this.renderer.paragraph(i);
813
+ break;
788
814
  }
789
815
  case "text": {
790
- let o = s, a = this.renderer.text(o);
791
- for (; r + 1 < e.length && e[r + 1].type === "text"; ) o = e[++r], a += `
792
- ` + this.renderer.text(o);
793
- t ? n += this.renderer.paragraph({ type: "paragraph", raw: a, text: a, tokens: [{ type: "text", raw: a, text: a, escaped: true }] }) : n += a;
794
- continue;
816
+ t += this.renderer.text(i);
817
+ break;
795
818
  }
796
819
  default: {
797
- let o = 'Token with "' + s.type + '" type was not found.';
798
- if (this.options.silent) return console.error(o), "";
799
- throw new Error(o);
820
+ let s = 'Token with "' + i.type + '" type was not found.';
821
+ if (this.options.silent) return console.error(s), "";
822
+ throw new Error(s);
800
823
  }
801
824
  }
802
825
  }
803
- return n;
826
+ return t;
804
827
  }
805
828
  parseInline(e, t = this.renderer) {
806
829
  let n = "";
807
830
  for (let r = 0; r < e.length; r++) {
808
831
  let i = e[r];
809
832
  if (this.options.extensions?.renderers?.[i.type]) {
810
- let o = this.options.extensions.renderers[i.type].call({ parser: this }, i);
811
- if (o !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
812
- n += o || "";
833
+ let a = this.options.extensions.renderers[i.type].call({ parser: this }, i);
834
+ if (a !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
835
+ n += a || "";
813
836
  continue;
814
837
  }
815
838
  }
@@ -831,6 +854,10 @@ var b = class u2 {
831
854
  n += t.image(s);
832
855
  break;
833
856
  }
857
+ case "checkbox": {
858
+ n += t.checkbox(s);
859
+ break;
860
+ }
834
861
  case "strong": {
835
862
  n += t.strong(s);
836
863
  break;
@@ -856,9 +883,9 @@ var b = class u2 {
856
883
  break;
857
884
  }
858
885
  default: {
859
- let o = 'Token with "' + s.type + '" type was not found.';
860
- if (this.options.silent) return console.error(o), "";
861
- throw new Error(o);
886
+ let a = 'Token with "' + s.type + '" type was not found.';
887
+ if (this.options.silent) return console.error(a), "";
888
+ throw new Error(a);
862
889
  }
863
890
  }
864
891
  }
@@ -912,7 +939,7 @@ var B = class {
912
939
  case "table": {
913
940
  let i = r;
914
941
  for (let s of i.header) n = n.concat(this.walkTokens(s.tokens, t));
915
- for (let s of i.rows) for (let o of s) n = n.concat(this.walkTokens(o.tokens, t));
942
+ for (let s of i.rows) for (let a of s) n = n.concat(this.walkTokens(a.tokens, t));
916
943
  break;
917
944
  }
918
945
  case "list": {
@@ -923,8 +950,8 @@ var B = class {
923
950
  default: {
924
951
  let i = r;
925
952
  this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((s) => {
926
- let o = i[s].flat(1 / 0);
927
- n = n.concat(this.walkTokens(o, t));
953
+ let a = i[s].flat(1 / 0);
954
+ n = n.concat(this.walkTokens(a, t));
928
955
  }) : i.tokens && (n = n.concat(this.walkTokens(i.tokens, t)));
929
956
  }
930
957
  }
@@ -938,9 +965,9 @@ var B = class {
938
965
  if (!i.name) throw new Error("extension name required");
939
966
  if ("renderer" in i) {
940
967
  let s = t.renderers[i.name];
941
- s ? t.renderers[i.name] = function(...o) {
942
- let a = i.renderer.apply(this, o);
943
- return a === false && (a = s.apply(this, o)), a;
968
+ s ? t.renderers[i.name] = function(...a) {
969
+ let o = i.renderer.apply(this, a);
970
+ return o === false && (o = s.apply(this, a)), o;
944
971
  } : t.renderers[i.name] = i.renderer;
945
972
  }
946
973
  if ("tokenizer" in i) {
@@ -954,10 +981,10 @@ var B = class {
954
981
  for (let s in n.renderer) {
955
982
  if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
956
983
  if (["options", "parser"].includes(s)) continue;
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 || "";
984
+ let a = s, o = n.renderer[a], l = i[a];
985
+ i[a] = (...p) => {
986
+ let c = o.apply(i, p);
987
+ return c === false && (c = l.apply(i, p)), c || "";
961
988
  };
962
989
  }
963
990
  r.renderer = i;
@@ -967,10 +994,10 @@ var B = class {
967
994
  for (let s in n.tokenizer) {
968
995
  if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
969
996
  if (["options", "rules", "lexer"].includes(s)) continue;
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;
997
+ let a = s, o = n.tokenizer[a], l = i[a];
998
+ i[a] = (...p) => {
999
+ let c = o.apply(i, p);
1000
+ return c === false && (c = l.apply(i, p)), c;
974
1001
  };
975
1002
  }
976
1003
  r.tokenizer = i;
@@ -980,30 +1007,30 @@ var B = class {
980
1007
  for (let s in n.hooks) {
981
1008
  if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
982
1009
  if (["options", "block"].includes(s)) continue;
983
- let o = s, a = n.hooks[o], l = i[o];
984
- S.passThroughHooks.has(s) ? i[o] = (c) => {
1010
+ let a = s, o = n.hooks[a], l = i[a];
1011
+ S.passThroughHooks.has(s) ? i[a] = (p) => {
985
1012
  if (this.defaults.async && S.passThroughHooksRespectAsync.has(s)) return (async () => {
986
- let g = await a.call(i, c);
1013
+ let g = await o.call(i, p);
987
1014
  return l.call(i, g);
988
1015
  })();
989
- let p = a.call(i, c);
990
- return l.call(i, p);
991
- } : i[o] = (...c) => {
1016
+ let c = o.call(i, p);
1017
+ return l.call(i, c);
1018
+ } : i[a] = (...p) => {
992
1019
  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;
1020
+ let g = await o.apply(i, p);
1021
+ return g === false && (g = await l.apply(i, p)), g;
995
1022
  })();
996
- let p = a.apply(i, c);
997
- return p === false && (p = l.apply(i, c)), p;
1023
+ let c = o.apply(i, p);
1024
+ return c === false && (c = l.apply(i, p)), c;
998
1025
  };
999
1026
  }
1000
1027
  r.hooks = i;
1001
1028
  }
1002
1029
  if (n.walkTokens) {
1003
1030
  let i = this.defaults.walkTokens, s = n.walkTokens;
1004
- r.walkTokens = function(o) {
1005
- let a = [];
1006
- return a.push(s.call(this, o)), i && (a = a.concat(i.call(this, o))), a;
1031
+ r.walkTokens = function(a) {
1032
+ let o = [];
1033
+ return o.push(s.call(this, a)), i && (o = o.concat(i.call(this, a))), o;
1007
1034
  };
1008
1035
  }
1009
1036
  this.defaults = { ...this.defaults, ...r };
@@ -1020,24 +1047,24 @@ var B = class {
1020
1047
  }
1021
1048
  parseMarkdown(e) {
1022
1049
  return (n, r) => {
1023
- let i = { ...r }, s = { ...this.defaults, ...i }, o = this.onError(!!s.silent, !!s.async);
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."));
1025
- if (typeof n > "u" || n === null) return o(new Error("marked(): input parameter is undefined or null"));
1026
- if (typeof n != "string") return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1050
+ let i = { ...r }, s = { ...this.defaults, ...i }, a = this.onError(!!s.silent, !!s.async);
1051
+ if (this.defaults.async === true && i.async === false) return a(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."));
1052
+ if (typeof n > "u" || n === null) return a(new Error("marked(): input parameter is undefined or null"));
1053
+ if (typeof n != "string") return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1027
1054
  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 d = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(p, s);
1031
- return s.hooks ? await s.hooks.postprocess(d) : d;
1032
- })().catch(o);
1055
+ let o = s.hooks ? await s.hooks.preprocess(n) : n, p = await (s.hooks ? await s.hooks.provideLexer() : e ? x.lex : x.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
1056
+ s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
1057
+ let h = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(c, s);
1058
+ return s.hooks ? await s.hooks.postprocess(h) : h;
1059
+ })().catch(a);
1033
1060
  try {
1034
1061
  s.hooks && (n = s.hooks.preprocess(n));
1035
1062
  let l = (s.hooks ? s.hooks.provideLexer() : e ? x.lex : x.lexInline)(n, s);
1036
1063
  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);
1064
+ let c = (s.hooks ? s.hooks.provideParser() : e ? b.parse : b.parseInline)(l, s);
1065
+ return s.hooks && (c = s.hooks.postprocess(c)), c;
1066
+ } catch (o) {
1067
+ return a(o);
1041
1068
  }
1042
1069
  };
1043
1070
  }
@@ -1054,35 +1081,35 @@ Please report this to https://github.com/markedjs/marked.`, e) {
1054
1081
  }
1055
1082
  };
1056
1083
  var _ = new B();
1057
- function k(u3, e) {
1084
+ function d(u3, e) {
1058
1085
  return _.parse(u3, e);
1059
1086
  }
1060
- k.options = k.setOptions = function(u3) {
1061
- return _.setOptions(u3), k.defaults = _.defaults, G(k.defaults), k;
1087
+ d.options = d.setOptions = function(u3) {
1088
+ return _.setOptions(u3), d.defaults = _.defaults, Z(d.defaults), d;
1062
1089
  };
1063
- k.getDefaults = L;
1064
- k.defaults = T;
1065
- k.use = function(...u3) {
1066
- return _.use(...u3), k.defaults = _.defaults, G(k.defaults), k;
1090
+ d.getDefaults = L;
1091
+ d.defaults = T;
1092
+ d.use = function(...u3) {
1093
+ return _.use(...u3), d.defaults = _.defaults, Z(d.defaults), d;
1067
1094
  };
1068
- k.walkTokens = function(u3, e) {
1095
+ d.walkTokens = function(u3, e) {
1069
1096
  return _.walkTokens(u3, e);
1070
1097
  };
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;
1098
+ d.parseInline = _.parseInline;
1099
+ d.Parser = b;
1100
+ d.parser = b.parse;
1101
+ d.Renderer = P;
1102
+ d.TextRenderer = $;
1103
+ d.Lexer = x;
1104
+ d.lexer = x.lex;
1105
+ d.Tokenizer = y;
1106
+ d.Hooks = S;
1107
+ d.parse = d;
1108
+ d.options;
1109
+ d.setOptions;
1110
+ d.use;
1111
+ d.walkTokens;
1112
+ d.parseInline;
1086
1113
  b.parse;
1087
1114
  x.lex;
1088
1115
  export {
@@ -1095,5 +1122,5 @@ export {
1095
1122
  y as Tokenizer,
1096
1123
  T as defaults,
1097
1124
  L as getDefaults,
1098
- k as marked
1125
+ d as marked
1099
1126
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elmethis/vue",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -24,39 +24,40 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@mdi/js": "^7.4.47",
27
- "@vueuse/core": "^14.0.0",
28
- "katex": "^0.16.25",
27
+ "@vueuse/core": "^14.1.0",
28
+ "katex": "^0.16.27",
29
29
  "lodash-es": "^4.17.21",
30
- "marked": "^16.4.1",
31
- "mermaid": "^11.12.1",
30
+ "marked": "^17.0.1",
31
+ "mermaid": "^11.12.2",
32
32
  "nanoid": "^5.1.6",
33
33
  "polished": "^4.3.1",
34
- "shiki": "^3.14.0"
34
+ "shiki": "^3.20.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@ag-ui/core": "^0.0.39",
38
- "@notionhq/client": "^5.3.0",
39
- "@storybook/vue3-vite": "10.0.3",
37
+ "@ag-ui/core": "^0.0.42",
38
+ "@notionhq/client": "^5.4.0",
39
+ "@storybook/vue3-vite": "10.1.6",
40
40
  "@types/json-schema": "^7.0.15",
41
41
  "@types/katex": "^0.16.7",
42
42
  "@types/lodash-es": "^4.17.12",
43
43
  "@types/prismjs": "^1.26.5",
44
- "@vitejs/plugin-vue": "^6.0.1",
45
- "csstype": "^3.1.3",
46
- "jarkup-ts": "^0.5.0",
44
+ "@vitejs/plugin-vue": "^6.0.2",
45
+ "csstype": "^3.2.3",
46
+ "jarkup-ts": "^0.6.0",
47
47
  "openapi-types": "^12.1.3",
48
48
  "postcss": "^8.5.6",
49
- "postcss-preset-env": "^10.4.0",
50
- "sass": "^1.93.3",
51
- "vite": "^7.1.12",
49
+ "postcss-preset-env": "^10.5.0",
50
+ "sass": "^1.95.1",
51
+ "vite": "^7.2.7",
52
52
  "vite-plugin-css-injected-by-js": "^3.5.2",
53
53
  "vite-plugin-dts": "^4.5.4",
54
- "vue-tsc": "^3.1.3"
54
+ "vue-tsc": "^3.1.8"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "vue": "^3.4.0"
58
58
  },
59
59
  "scripts": {
60
- "build": "vue-tsc && vite build"
60
+ "build": "vue-tsc && vite build",
61
+ "check": "vue-tsc -p tsconfig.app.json"
61
62
  }
62
63
  }