advaisor-chatbot 1.10.0 → 1.11.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/dist/testchatbot.js +186 -220
- package/package.json +1 -1
package/dist/testchatbot.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
(() => {
|
|
2
|
-
//
|
|
3
|
-
function
|
|
2
|
+
// node_modules/marked/lib/marked.esm.js
|
|
3
|
+
function L() {
|
|
4
4
|
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
5
5
|
}
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
|
|
6
|
+
var T = L();
|
|
7
|
+
function Z(u3) {
|
|
8
|
+
T = u3;
|
|
9
9
|
}
|
|
10
|
-
var
|
|
10
|
+
var C = { exec: () => null };
|
|
11
11
|
function k(u3, e = "") {
|
|
12
12
|
let t = typeof u3 == "string" ? u3 : u3.source, n = { replace: (r, i) => {
|
|
13
13
|
let s = typeof i == "string" ? i : i.source;
|
|
@@ -15,85 +15,82 @@
|
|
|
15
15
|
}, getRegex: () => new RegExp(t, e) };
|
|
16
16
|
return n;
|
|
17
17
|
}
|
|
18
|
-
var
|
|
18
|
+
var me = (() => {
|
|
19
19
|
try {
|
|
20
20
|
return !!new RegExp("(?<=1)(?<!1)");
|
|
21
21
|
} catch {
|
|
22
22
|
return false;
|
|
23
23
|
}
|
|
24
24
|
})();
|
|
25
|
-
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, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (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")
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var
|
|
25
|
+
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]\] +\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") };
|
|
26
|
+
var xe = /^(?:[ \t]*(?:\n|$))+/;
|
|
27
|
+
var be = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
|
|
28
|
+
var Re = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
|
|
29
|
+
var I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
|
|
30
|
+
var Te = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
|
|
31
|
+
var N = /(?:[*+-]|\d{1,9}[.)])/;
|
|
32
|
+
var re = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
|
|
33
|
+
var 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();
|
|
34
|
+
var 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();
|
|
35
|
+
var Q = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
|
|
36
|
+
var we = /^[^\n]+/;
|
|
37
37
|
var F = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
|
|
38
|
-
var
|
|
39
|
-
var
|
|
38
|
+
var 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();
|
|
39
|
+
var Pe = k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, N).getRegex();
|
|
40
40
|
var 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";
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
]`).replace("lheading",
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
41
|
+
var j = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
|
|
42
|
+
var 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();
|
|
43
|
+
var 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();
|
|
44
|
+
var $e = k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ie).getRegex();
|
|
45
|
+
var 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 };
|
|
46
|
+
var 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();
|
|
47
|
+
var _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() };
|
|
48
|
+
var 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} *[^
|
|
49
|
+
]`).replace("lheading", se).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
|
|
50
|
+
var Me = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
|
|
51
|
+
var ze = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
|
|
52
|
+
var oe = /^( {2,}|\\)\n(?!\s*$)/;
|
|
53
53
|
var Ae = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
var Ce = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g,
|
|
54
|
+
var D = /[\p{P}\p{S}]/u;
|
|
55
|
+
var K = /[\s\p{P}\p{S}]/u;
|
|
56
|
+
var ae = /[^\s\p{P}\p{S}]/u;
|
|
57
|
+
var Ce = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, K).getRegex();
|
|
58
58
|
var le = /(?!~)[\p{P}\p{S}]/u;
|
|
59
|
-
var
|
|
60
|
-
var
|
|
61
|
-
var
|
|
62
|
-
var ue = /^(?:\*+(?:((?!\*)punct)|
|
|
63
|
-
var
|
|
64
|
-
var
|
|
59
|
+
var Ie = /(?!~)[\s\p{P}\p{S}]/u;
|
|
60
|
+
var Ee = /(?:[^\s\p{P}\p{S}]|~)/u;
|
|
61
|
+
var 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();
|
|
62
|
+
var ue = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
|
|
63
|
+
var qe = k(ue, "u").replace(/punct/g, D).getRegex();
|
|
64
|
+
var ve = k(ue, "u").replace(/punct/g, le).getRegex();
|
|
65
65
|
var pe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
|
|
66
|
-
var
|
|
67
|
-
var
|
|
68
|
-
var
|
|
69
|
-
var
|
|
70
|
-
var
|
|
71
|
-
var
|
|
72
|
-
var
|
|
73
|
-
var
|
|
74
|
-
var
|
|
75
|
-
var Xe = 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", We).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
|
|
76
|
-
var q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/;
|
|
77
|
-
var Je = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
|
|
66
|
+
var De = k(pe, "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, D).getRegex();
|
|
67
|
+
var He = k(pe, "gu").replace(/notPunctSpace/g, Ee).replace(/punctSpace/g, Ie).replace(/punct/g, le).getRegex();
|
|
68
|
+
var 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();
|
|
69
|
+
var Ge = k(/\\(punct)/, "gu").replace(/punct/g, D).getRegex();
|
|
70
|
+
var 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();
|
|
71
|
+
var Qe = k(j).replace("(?:-->|$)", "-->").getRegex();
|
|
72
|
+
var 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();
|
|
73
|
+
var q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/;
|
|
74
|
+
var je = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
|
|
78
75
|
var ce = k(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", F).getRegex();
|
|
79
76
|
var he = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", F).getRegex();
|
|
80
|
-
var
|
|
81
|
-
var
|
|
82
|
-
var
|
|
83
|
-
var
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
var
|
|
87
|
-
var
|
|
88
|
-
var
|
|
89
|
-
var ke = (u3) =>
|
|
90
|
-
function
|
|
77
|
+
var Ue = k("reflink|nolink(?!\\()", "g").replace("reflink", ce).replace("nolink", he).getRegex();
|
|
78
|
+
var ne = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
|
|
79
|
+
var 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 };
|
|
80
|
+
var Ke = { ...W, link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() };
|
|
81
|
+
var 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() };
|
|
82
|
+
var We = { ...G, br: k(oe).replace("{2,}", "*").getRegex(), text: k(G.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
|
|
83
|
+
var E = { normal: U, gfm: _e, pedantic: Le };
|
|
84
|
+
var M = { normal: W, gfm: G, breaks: We, pedantic: Ke };
|
|
85
|
+
var Xe = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
|
|
86
|
+
var ke = (u3) => Xe[u3];
|
|
87
|
+
function w(u3, e) {
|
|
91
88
|
if (e) {
|
|
92
89
|
if (m.escapeTest.test(u3)) return u3.replace(m.escapeReplace, ke);
|
|
93
90
|
} else if (m.escapeTestNoEncode.test(u3)) return u3.replace(m.escapeReplaceNoEncode, ke);
|
|
94
91
|
return u3;
|
|
95
92
|
}
|
|
96
|
-
function
|
|
93
|
+
function X(u3) {
|
|
97
94
|
try {
|
|
98
95
|
u3 = encodeURI(u3).replace(m.percentDecode, "%");
|
|
99
96
|
} catch {
|
|
@@ -101,7 +98,7 @@
|
|
|
101
98
|
}
|
|
102
99
|
return u3;
|
|
103
100
|
}
|
|
104
|
-
function
|
|
101
|
+
function J(u3, e) {
|
|
105
102
|
let t = u3.replace(m.findPipe, (i, s, a) => {
|
|
106
103
|
let o = false, l = s;
|
|
107
104
|
for (; --l >= 0 && a[l] === "\\"; ) o = !o;
|
|
@@ -112,7 +109,7 @@
|
|
|
112
109
|
for (; r < n.length; r++) n[r] = n[r].trim().replace(m.slashPipe, "|");
|
|
113
110
|
return n;
|
|
114
111
|
}
|
|
115
|
-
function
|
|
112
|
+
function z(u3, e, t) {
|
|
116
113
|
let n = u3.length;
|
|
117
114
|
if (n === 0) return "";
|
|
118
115
|
let r = 0;
|
|
@@ -132,21 +129,13 @@
|
|
|
132
129
|
else if (u3[n] === e[1] && (t--, t < 0)) return n;
|
|
133
130
|
return t > 0 ? -2 : -1;
|
|
134
131
|
}
|
|
135
|
-
function ge(u3, e
|
|
136
|
-
let t = e, n = "";
|
|
137
|
-
for (let r of u3) if (r === " ") {
|
|
138
|
-
let i = 4 - t % 4;
|
|
139
|
-
n += " ".repeat(i), t += i;
|
|
140
|
-
} else n += r, t++;
|
|
141
|
-
return n;
|
|
142
|
-
}
|
|
143
|
-
function fe(u3, e, t, n, r) {
|
|
132
|
+
function ge(u3, e, t, n, r) {
|
|
144
133
|
let i = e.href, s = e.title || null, a = u3[1].replace(r.other.outputLinkReplace, "$1");
|
|
145
134
|
n.state.inLink = true;
|
|
146
135
|
let o = { type: u3[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: s, text: a, tokens: n.inlineTokens(a) };
|
|
147
136
|
return n.state.inLink = false, o;
|
|
148
137
|
}
|
|
149
|
-
function
|
|
138
|
+
function Je(u3, e, t) {
|
|
150
139
|
let n = u3.match(t.other.indentCodeCompensation);
|
|
151
140
|
if (n === null) return e;
|
|
152
141
|
let r = n[1];
|
|
@@ -159,12 +148,12 @@
|
|
|
159
148
|
}).join(`
|
|
160
149
|
`);
|
|
161
150
|
}
|
|
162
|
-
var
|
|
151
|
+
var y = class {
|
|
163
152
|
options;
|
|
164
153
|
rules;
|
|
165
154
|
lexer;
|
|
166
155
|
constructor(e) {
|
|
167
|
-
this.options = e ||
|
|
156
|
+
this.options = e || T;
|
|
168
157
|
}
|
|
169
158
|
space(e) {
|
|
170
159
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -174,14 +163,14 @@
|
|
|
174
163
|
let t = this.rules.block.code.exec(e);
|
|
175
164
|
if (t) {
|
|
176
165
|
let n = t[0].replace(this.rules.other.codeRemoveIndent, "");
|
|
177
|
-
return { type: "code", raw: t[0], codeBlockStyle: "indented", text: this.options.pedantic ? n :
|
|
166
|
+
return { type: "code", raw: t[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : z(n, `
|
|
178
167
|
`) };
|
|
179
168
|
}
|
|
180
169
|
}
|
|
181
170
|
fences(e) {
|
|
182
171
|
let t = this.rules.block.fences.exec(e);
|
|
183
172
|
if (t) {
|
|
184
|
-
let n = t[0], r =
|
|
173
|
+
let n = t[0], r = Je(n, t[3] || "", this.rules);
|
|
185
174
|
return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: r };
|
|
186
175
|
}
|
|
187
176
|
}
|
|
@@ -190,7 +179,7 @@
|
|
|
190
179
|
if (t) {
|
|
191
180
|
let n = t[2].trim();
|
|
192
181
|
if (this.rules.other.endingHash.test(n)) {
|
|
193
|
-
let r =
|
|
182
|
+
let r = z(n, "#");
|
|
194
183
|
(this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
|
|
195
184
|
}
|
|
196
185
|
return { type: "heading", raw: t[0], depth: t[1].length, text: n, tokens: this.lexer.inline(n) };
|
|
@@ -198,13 +187,13 @@
|
|
|
198
187
|
}
|
|
199
188
|
hr(e) {
|
|
200
189
|
let t = this.rules.block.hr.exec(e);
|
|
201
|
-
if (t) return { type: "hr", raw:
|
|
190
|
+
if (t) return { type: "hr", raw: z(t[0], `
|
|
202
191
|
`) };
|
|
203
192
|
}
|
|
204
193
|
blockquote(e) {
|
|
205
194
|
let t = this.rules.block.blockquote.exec(e);
|
|
206
195
|
if (t) {
|
|
207
|
-
let n =
|
|
196
|
+
let n = z(t[0], `
|
|
208
197
|
`).split(`
|
|
209
198
|
`), r = "", i = "", s = [];
|
|
210
199
|
for (; n.length > 0; ) {
|
|
@@ -219,21 +208,21 @@
|
|
|
219
208
|
r = r ? `${r}
|
|
220
209
|
${p}` : p, i = i ? `${i}
|
|
221
210
|
${c}` : c;
|
|
222
|
-
let
|
|
223
|
-
if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top =
|
|
211
|
+
let g = this.lexer.state.top;
|
|
212
|
+
if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top = g, n.length === 0) break;
|
|
224
213
|
let h = s.at(-1);
|
|
225
214
|
if (h?.type === "code") break;
|
|
226
215
|
if (h?.type === "blockquote") {
|
|
227
216
|
let R = h, f = R.raw + `
|
|
228
217
|
` + n.join(`
|
|
229
|
-
`),
|
|
230
|
-
s[s.length - 1] =
|
|
218
|
+
`), O = this.blockquote(f);
|
|
219
|
+
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;
|
|
231
220
|
break;
|
|
232
221
|
} else if (h?.type === "list") {
|
|
233
222
|
let R = h, f = R.raw + `
|
|
234
223
|
` + n.join(`
|
|
235
|
-
`),
|
|
236
|
-
s[s.length - 1] =
|
|
224
|
+
`), O = this.list(f);
|
|
225
|
+
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(`
|
|
237
226
|
`);
|
|
238
227
|
continue;
|
|
239
228
|
}
|
|
@@ -251,25 +240,25 @@ ${c}` : c;
|
|
|
251
240
|
let l = false, p = "", c = "";
|
|
252
241
|
if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
253
242
|
p = t[0], e = e.substring(p.length);
|
|
254
|
-
let
|
|
255
|
-
`, 1)[0],
|
|
256
|
-
`, 1)[0], R = !
|
|
257
|
-
if (this.options.pedantic ? (f = 2, c =
|
|
243
|
+
let g = t[2].split(`
|
|
244
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, (O) => " ".repeat(3 * O.length)), h = e.split(`
|
|
245
|
+
`, 1)[0], R = !g.trim(), f = 0;
|
|
246
|
+
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 + `
|
|
258
247
|
`, e = e.substring(h.length + 1), l = true), !l) {
|
|
259
|
-
let
|
|
248
|
+
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);
|
|
260
249
|
for (; e; ) {
|
|
261
|
-
let
|
|
250
|
+
let H = e.split(`
|
|
262
251
|
`, 1)[0], A;
|
|
263
|
-
if (h =
|
|
252
|
+
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;
|
|
264
253
|
if (A.search(this.rules.other.nonSpaceChar) >= f || !h.trim()) c += `
|
|
265
254
|
` + A.slice(f);
|
|
266
255
|
else {
|
|
267
|
-
if (R ||
|
|
256
|
+
if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || Y.test(g) || ee.test(g) || V.test(g)) break;
|
|
268
257
|
c += `
|
|
269
258
|
` + h;
|
|
270
259
|
}
|
|
271
|
-
R
|
|
272
|
-
`, e = e.substring(
|
|
260
|
+
!R && !h.trim() && (R = true), p += H + `
|
|
261
|
+
`, e = e.substring(H.length + 1), g = A.slice(f);
|
|
273
262
|
}
|
|
274
263
|
}
|
|
275
264
|
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;
|
|
@@ -294,7 +283,7 @@ ${c}` : c;
|
|
|
294
283
|
}
|
|
295
284
|
}
|
|
296
285
|
if (!i.loose) {
|
|
297
|
-
let p = l.tokens.filter((
|
|
286
|
+
let p = l.tokens.filter((g) => g.type === "space"), c = p.length > 0 && p.some((g) => this.rules.other.anyLine.test(g.raw));
|
|
298
287
|
i.loose = c;
|
|
299
288
|
}
|
|
300
289
|
}
|
|
@@ -319,21 +308,18 @@ ${c}` : c;
|
|
|
319
308
|
table(e) {
|
|
320
309
|
let t = this.rules.block.table.exec(e);
|
|
321
310
|
if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
|
|
322
|
-
let n =
|
|
311
|
+
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(`
|
|
323
312
|
`) : [], s = { type: "table", raw: t[0], header: [], align: [], rows: [] };
|
|
324
313
|
if (n.length === r.length) {
|
|
325
314
|
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);
|
|
326
315
|
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] });
|
|
327
|
-
for (let a of i) s.rows.push(
|
|
316
|
+
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] })));
|
|
328
317
|
return s;
|
|
329
318
|
}
|
|
330
319
|
}
|
|
331
320
|
lheading(e) {
|
|
332
321
|
let t = this.rules.block.lheading.exec(e);
|
|
333
|
-
if (t) {
|
|
334
|
-
let n = t[1].trim();
|
|
335
|
-
return { type: "heading", raw: t[0], depth: t[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
|
|
336
|
-
}
|
|
322
|
+
if (t) return { type: "heading", raw: t[0], depth: t[2].charAt(0) === "=" ? 1 : 2, text: t[1], tokens: this.lexer.inline(t[1]) };
|
|
337
323
|
}
|
|
338
324
|
paragraph(e) {
|
|
339
325
|
let t = this.rules.block.paragraph.exec(e);
|
|
@@ -361,7 +347,7 @@ ${c}` : c;
|
|
|
361
347
|
let n = t[2].trim();
|
|
362
348
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
|
|
363
349
|
if (!this.rules.other.endAngleBracket.test(n)) return;
|
|
364
|
-
let s =
|
|
350
|
+
let s = z(n.slice(0, -1), "\\");
|
|
365
351
|
if ((n.length - s.length) % 2 === 0) return;
|
|
366
352
|
} else {
|
|
367
353
|
let s = de(t[2], "()");
|
|
@@ -376,7 +362,7 @@ ${c}` : c;
|
|
|
376
362
|
let s = this.rules.other.pedanticHrefTitle.exec(r);
|
|
377
363
|
s && (r = s[1], i = s[3]);
|
|
378
364
|
} else i = t[3] ? t[3].slice(1, -1) : "";
|
|
379
|
-
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)),
|
|
365
|
+
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);
|
|
380
366
|
}
|
|
381
367
|
}
|
|
382
368
|
reflink(e, t) {
|
|
@@ -387,15 +373,15 @@ ${c}` : c;
|
|
|
387
373
|
let s = n[0].charAt(0);
|
|
388
374
|
return { type: "text", raw: s, text: s };
|
|
389
375
|
}
|
|
390
|
-
return
|
|
376
|
+
return ge(n, i, n[0], this.lexer, this.rules);
|
|
391
377
|
}
|
|
392
378
|
}
|
|
393
379
|
emStrong(e, t, n = "") {
|
|
394
380
|
let r = this.rules.inline.emStrongLDelim.exec(e);
|
|
395
|
-
if (!r ||
|
|
396
|
-
if (!(r[1] || r[
|
|
381
|
+
if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
|
|
382
|
+
if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
397
383
|
let s = [...r[0]].length - 1, a, o, l = s, p = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
398
|
-
for (c.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = c.exec(t))
|
|
384
|
+
for (c.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = c.exec(t)) != null; ) {
|
|
399
385
|
if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a) continue;
|
|
400
386
|
if (o = [...a].length, r[3] || r[4]) {
|
|
401
387
|
l += o;
|
|
@@ -406,7 +392,7 @@ ${c}` : c;
|
|
|
406
392
|
}
|
|
407
393
|
if (l -= o, l > 0) continue;
|
|
408
394
|
o = Math.min(o, o + l + p);
|
|
409
|
-
let
|
|
395
|
+
let g = [...r[0]][0].length, h = e.slice(0, s + r.index + g + o);
|
|
410
396
|
if (Math.min(s, o) % 2) {
|
|
411
397
|
let f = h.slice(1, -1);
|
|
412
398
|
return { type: "em", raw: h, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
@@ -427,23 +413,9 @@ ${c}` : c;
|
|
|
427
413
|
let t = this.rules.inline.br.exec(e);
|
|
428
414
|
if (t) return { type: "br", raw: t[0] };
|
|
429
415
|
}
|
|
430
|
-
del(e
|
|
431
|
-
let
|
|
432
|
-
if (
|
|
433
|
-
if (!(r[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
434
|
-
let s = [...r[0]].length - 1, a, o, l = s, p = this.rules.inline.delRDelim;
|
|
435
|
-
for (p.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = p.exec(t)) !== null; ) {
|
|
436
|
-
if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a || (o = [...a].length, o !== s)) continue;
|
|
437
|
-
if (r[3] || r[4]) {
|
|
438
|
-
l += o;
|
|
439
|
-
continue;
|
|
440
|
-
}
|
|
441
|
-
if (l -= o, l > 0) continue;
|
|
442
|
-
o = Math.min(o, o + l);
|
|
443
|
-
let c = [...r[0]][0].length, d = e.slice(0, s + r.index + c + o), h = d.slice(s, -s);
|
|
444
|
-
return { type: "del", raw: d, text: h, tokens: this.lexer.inlineTokens(h) };
|
|
445
|
-
}
|
|
446
|
-
}
|
|
416
|
+
del(e) {
|
|
417
|
+
let t = this.rules.inline.del.exec(e);
|
|
418
|
+
if (t) return { type: "del", raw: t[0], text: t[2], tokens: this.lexer.inlineTokens(t[2]) };
|
|
447
419
|
}
|
|
448
420
|
autolink(e) {
|
|
449
421
|
let t = this.rules.inline.autolink.exec(e);
|
|
@@ -482,12 +454,12 @@ ${c}` : c;
|
|
|
482
454
|
inlineQueue;
|
|
483
455
|
tokenizer;
|
|
484
456
|
constructor(e) {
|
|
485
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e ||
|
|
486
|
-
let t = { other: m, block:
|
|
487
|
-
this.options.pedantic ? (t.block =
|
|
457
|
+
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 };
|
|
458
|
+
let t = { other: m, block: E.normal, inline: M.normal };
|
|
459
|
+
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;
|
|
488
460
|
}
|
|
489
461
|
static get rules() {
|
|
490
|
-
return { block:
|
|
462
|
+
return { block: E, inline: M };
|
|
491
463
|
}
|
|
492
464
|
static lex(e, t) {
|
|
493
465
|
return new u(t).lex(e);
|
|
@@ -505,7 +477,7 @@ ${c}` : c;
|
|
|
505
477
|
return this.inlineQueue = [], this.tokens;
|
|
506
478
|
}
|
|
507
479
|
blockTokens(e, t = [], n = false) {
|
|
508
|
-
for (this.
|
|
480
|
+
for (this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e; ) {
|
|
509
481
|
let r;
|
|
510
482
|
if (this.options.extensions?.block?.some((s) => (r = s.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), true) : false)) continue;
|
|
511
483
|
if (r = this.tokenizer.space(e)) {
|
|
@@ -603,15 +575,14 @@ ${c}` : c;
|
|
|
603
575
|
return this.inlineQueue.push({ src: e, tokens: t }), t;
|
|
604
576
|
}
|
|
605
577
|
inlineTokens(e, t = []) {
|
|
606
|
-
this.tokenizer.lexer = this;
|
|
607
578
|
let n = e, r = null;
|
|
608
579
|
if (this.tokens.links) {
|
|
609
580
|
let o = Object.keys(this.tokens.links);
|
|
610
|
-
if (o.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n))
|
|
581
|
+
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));
|
|
611
582
|
}
|
|
612
|
-
for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n))
|
|
583
|
+
for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null; ) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
613
584
|
let i;
|
|
614
|
-
for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n))
|
|
585
|
+
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);
|
|
615
586
|
n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
|
|
616
587
|
let s = false, a = "";
|
|
617
588
|
for (; e; ) {
|
|
@@ -648,7 +619,7 @@ ${c}` : c;
|
|
|
648
619
|
e = e.substring(o.raw.length), t.push(o);
|
|
649
620
|
continue;
|
|
650
621
|
}
|
|
651
|
-
if (o = this.tokenizer.del(e
|
|
622
|
+
if (o = this.tokenizer.del(e)) {
|
|
652
623
|
e = e.substring(o.raw.length), t.push(o);
|
|
653
624
|
continue;
|
|
654
625
|
}
|
|
@@ -662,9 +633,9 @@ ${c}` : c;
|
|
|
662
633
|
}
|
|
663
634
|
let l = e;
|
|
664
635
|
if (this.options.extensions?.startInline) {
|
|
665
|
-
let p = 1 / 0, c = e.slice(1),
|
|
636
|
+
let p = 1 / 0, c = e.slice(1), g;
|
|
666
637
|
this.options.extensions.startInline.forEach((h) => {
|
|
667
|
-
|
|
638
|
+
g = h.call({ lexer: this }, c), typeof g == "number" && g >= 0 && (p = Math.min(p, g));
|
|
668
639
|
}), p < 1 / 0 && p >= 0 && (l = e.substring(0, p + 1));
|
|
669
640
|
}
|
|
670
641
|
if (o = this.tokenizer.inlineText(l)) {
|
|
@@ -684,11 +655,11 @@ ${c}` : c;
|
|
|
684
655
|
return t;
|
|
685
656
|
}
|
|
686
657
|
};
|
|
687
|
-
var
|
|
658
|
+
var P = class {
|
|
688
659
|
options;
|
|
689
660
|
parser;
|
|
690
661
|
constructor(e) {
|
|
691
|
-
this.options = e ||
|
|
662
|
+
this.options = e || T;
|
|
692
663
|
}
|
|
693
664
|
space(e) {
|
|
694
665
|
return "";
|
|
@@ -696,8 +667,8 @@ ${c}` : c;
|
|
|
696
667
|
code({ text: e, lang: t, escaped: n }) {
|
|
697
668
|
let r = (t || "").match(m.notSpaceStart)?.[0], i = e.replace(m.endingNewline, "") + `
|
|
698
669
|
`;
|
|
699
|
-
return r ? '<pre><code class="language-' +
|
|
700
|
-
` : "<pre><code>" + (n ? i :
|
|
670
|
+
return r ? '<pre><code class="language-' + w(r) + '">' + (n ? i : w(i, true)) + `</code></pre>
|
|
671
|
+
` : "<pre><code>" + (n ? i : w(i, true)) + `</code></pre>
|
|
701
672
|
`;
|
|
702
673
|
}
|
|
703
674
|
blockquote({ tokens: e }) {
|
|
@@ -775,7 +746,7 @@ ${e}</tr>
|
|
|
775
746
|
return `<em>${this.parser.parseInline(e)}</em>`;
|
|
776
747
|
}
|
|
777
748
|
codespan({ text: e }) {
|
|
778
|
-
return `<code>${
|
|
749
|
+
return `<code>${w(e, true)}</code>`;
|
|
779
750
|
}
|
|
780
751
|
br(e) {
|
|
781
752
|
return "<br>";
|
|
@@ -784,22 +755,22 @@ ${e}</tr>
|
|
|
784
755
|
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
785
756
|
}
|
|
786
757
|
link({ href: e, title: t, tokens: n }) {
|
|
787
|
-
let r = this.parser.parseInline(n), i =
|
|
758
|
+
let r = this.parser.parseInline(n), i = X(e);
|
|
788
759
|
if (i === null) return r;
|
|
789
760
|
e = i;
|
|
790
761
|
let s = '<a href="' + e + '"';
|
|
791
|
-
return t && (s += ' title="' +
|
|
762
|
+
return t && (s += ' title="' + w(t) + '"'), s += ">" + r + "</a>", s;
|
|
792
763
|
}
|
|
793
764
|
image({ href: e, title: t, text: n, tokens: r }) {
|
|
794
765
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
795
|
-
let i =
|
|
796
|
-
if (i === null) return
|
|
766
|
+
let i = X(e);
|
|
767
|
+
if (i === null) return w(n);
|
|
797
768
|
e = i;
|
|
798
|
-
let s = `<img src="${e}" alt="${
|
|
799
|
-
return t && (s += ` title="${
|
|
769
|
+
let s = `<img src="${e}" alt="${n}"`;
|
|
770
|
+
return t && (s += ` title="${w(t)}"`), s += ">", s;
|
|
800
771
|
}
|
|
801
772
|
text(e) {
|
|
802
|
-
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text :
|
|
773
|
+
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : w(e.text);
|
|
803
774
|
}
|
|
804
775
|
};
|
|
805
776
|
var $ = class {
|
|
@@ -839,7 +810,7 @@ ${e}</tr>
|
|
|
839
810
|
renderer;
|
|
840
811
|
textRenderer;
|
|
841
812
|
constructor(e) {
|
|
842
|
-
this.options = e ||
|
|
813
|
+
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 $();
|
|
843
814
|
}
|
|
844
815
|
static parse(e, t) {
|
|
845
816
|
return new u2(t).parse(e);
|
|
@@ -848,7 +819,6 @@ ${e}</tr>
|
|
|
848
819
|
return new u2(t).parseInline(e);
|
|
849
820
|
}
|
|
850
821
|
parse(e) {
|
|
851
|
-
this.renderer.parser = this;
|
|
852
822
|
let t = "";
|
|
853
823
|
for (let n = 0; n < e.length; n++) {
|
|
854
824
|
let r = e[n];
|
|
@@ -919,7 +889,6 @@ ${e}</tr>
|
|
|
919
889
|
return t;
|
|
920
890
|
}
|
|
921
891
|
parseInline(e, t = this.renderer) {
|
|
922
|
-
this.renderer.parser = this;
|
|
923
892
|
let n = "";
|
|
924
893
|
for (let r = 0; r < e.length; r++) {
|
|
925
894
|
let i = e[r];
|
|
@@ -986,11 +955,11 @@ ${e}</tr>
|
|
|
986
955
|
return n;
|
|
987
956
|
}
|
|
988
957
|
};
|
|
989
|
-
var
|
|
958
|
+
var S = class {
|
|
990
959
|
options;
|
|
991
960
|
block;
|
|
992
961
|
constructor(e) {
|
|
993
|
-
this.options = e ||
|
|
962
|
+
this.options = e || T;
|
|
994
963
|
}
|
|
995
964
|
static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
|
|
996
965
|
static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
|
|
@@ -1006,24 +975,24 @@ ${e}</tr>
|
|
|
1006
975
|
emStrongMask(e) {
|
|
1007
976
|
return e;
|
|
1008
977
|
}
|
|
1009
|
-
provideLexer(
|
|
1010
|
-
return
|
|
978
|
+
provideLexer() {
|
|
979
|
+
return this.block ? x.lex : x.lexInline;
|
|
1011
980
|
}
|
|
1012
|
-
provideParser(
|
|
1013
|
-
return
|
|
981
|
+
provideParser() {
|
|
982
|
+
return this.block ? b.parse : b.parseInline;
|
|
1014
983
|
}
|
|
1015
984
|
};
|
|
1016
|
-
var
|
|
1017
|
-
defaults =
|
|
985
|
+
var B = class {
|
|
986
|
+
defaults = L();
|
|
1018
987
|
options = this.setOptions;
|
|
1019
988
|
parse = this.parseMarkdown(true);
|
|
1020
989
|
parseInline = this.parseMarkdown(false);
|
|
1021
990
|
Parser = b;
|
|
1022
|
-
Renderer =
|
|
991
|
+
Renderer = P;
|
|
1023
992
|
TextRenderer = $;
|
|
1024
993
|
Lexer = x;
|
|
1025
|
-
Tokenizer =
|
|
1026
|
-
Hooks =
|
|
994
|
+
Tokenizer = y;
|
|
995
|
+
Hooks = S;
|
|
1027
996
|
constructor(...e) {
|
|
1028
997
|
this.use(...e);
|
|
1029
998
|
}
|
|
@@ -1071,7 +1040,7 @@ ${e}</tr>
|
|
|
1071
1040
|
}
|
|
1072
1041
|
"childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
|
|
1073
1042
|
}), r.extensions = t), n.renderer) {
|
|
1074
|
-
let i = this.defaults.renderer || new
|
|
1043
|
+
let i = this.defaults.renderer || new P(this.defaults);
|
|
1075
1044
|
for (let s in n.renderer) {
|
|
1076
1045
|
if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
|
|
1077
1046
|
if (["options", "parser"].includes(s)) continue;
|
|
@@ -1084,7 +1053,7 @@ ${e}</tr>
|
|
|
1084
1053
|
r.renderer = i;
|
|
1085
1054
|
}
|
|
1086
1055
|
if (n.tokenizer) {
|
|
1087
|
-
let i = this.defaults.tokenizer || new
|
|
1056
|
+
let i = this.defaults.tokenizer || new y(this.defaults);
|
|
1088
1057
|
for (let s in n.tokenizer) {
|
|
1089
1058
|
if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
|
|
1090
1059
|
if (["options", "rules", "lexer"].includes(s)) continue;
|
|
@@ -1097,22 +1066,22 @@ ${e}</tr>
|
|
|
1097
1066
|
r.tokenizer = i;
|
|
1098
1067
|
}
|
|
1099
1068
|
if (n.hooks) {
|
|
1100
|
-
let i = this.defaults.hooks || new
|
|
1069
|
+
let i = this.defaults.hooks || new S();
|
|
1101
1070
|
for (let s in n.hooks) {
|
|
1102
1071
|
if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
|
|
1103
1072
|
if (["options", "block"].includes(s)) continue;
|
|
1104
1073
|
let a = s, o = n.hooks[a], l = i[a];
|
|
1105
|
-
|
|
1106
|
-
if (this.defaults.async &&
|
|
1107
|
-
let
|
|
1108
|
-
return l.call(i,
|
|
1074
|
+
S.passThroughHooks.has(s) ? i[a] = (p) => {
|
|
1075
|
+
if (this.defaults.async && S.passThroughHooksRespectAsync.has(s)) return (async () => {
|
|
1076
|
+
let g = await o.call(i, p);
|
|
1077
|
+
return l.call(i, g);
|
|
1109
1078
|
})();
|
|
1110
1079
|
let c = o.call(i, p);
|
|
1111
1080
|
return l.call(i, c);
|
|
1112
1081
|
} : i[a] = (...p) => {
|
|
1113
1082
|
if (this.defaults.async) return (async () => {
|
|
1114
|
-
let
|
|
1115
|
-
return
|
|
1083
|
+
let g = await o.apply(i, p);
|
|
1084
|
+
return g === false && (g = await l.apply(i, p)), g;
|
|
1116
1085
|
})();
|
|
1117
1086
|
let c = o.apply(i, p);
|
|
1118
1087
|
return c === false && (c = l.apply(i, p)), c;
|
|
@@ -1146,16 +1115,16 @@ ${e}</tr>
|
|
|
1146
1115
|
if (typeof n > "u" || n === null) return a(new Error("marked(): input parameter is undefined or null"));
|
|
1147
1116
|
if (typeof n != "string") return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
|
|
1148
1117
|
if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return (async () => {
|
|
1149
|
-
let o = s.hooks ? await s.hooks.preprocess(n) : n, p = await (s.hooks ? await s.hooks.provideLexer(
|
|
1118
|
+
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;
|
|
1150
1119
|
s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
|
|
1151
|
-
let h = await (s.hooks ? await s.hooks.provideParser(
|
|
1120
|
+
let h = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(c, s);
|
|
1152
1121
|
return s.hooks ? await s.hooks.postprocess(h) : h;
|
|
1153
1122
|
})().catch(a);
|
|
1154
1123
|
try {
|
|
1155
1124
|
s.hooks && (n = s.hooks.preprocess(n));
|
|
1156
|
-
let l = (s.hooks ? s.hooks.provideLexer(
|
|
1125
|
+
let l = (s.hooks ? s.hooks.provideLexer() : e ? x.lex : x.lexInline)(n, s);
|
|
1157
1126
|
s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
|
|
1158
|
-
let c = (s.hooks ? s.hooks.provideParser(
|
|
1127
|
+
let c = (s.hooks ? s.hooks.provideParser() : e ? b.parse : b.parseInline)(l, s);
|
|
1159
1128
|
return s.hooks && (c = s.hooks.postprocess(c)), c;
|
|
1160
1129
|
} catch (o) {
|
|
1161
1130
|
return a(o);
|
|
@@ -1166,7 +1135,7 @@ ${e}</tr>
|
|
|
1166
1135
|
return (n) => {
|
|
1167
1136
|
if (n.message += `
|
|
1168
1137
|
Please report this to https://github.com/markedjs/marked.`, e) {
|
|
1169
|
-
let r = "<p>An error occurred:</p><pre>" +
|
|
1138
|
+
let r = "<p>An error occurred:</p><pre>" + w(n.message + "", true) + "</pre>";
|
|
1170
1139
|
return t ? Promise.resolve(r) : r;
|
|
1171
1140
|
}
|
|
1172
1141
|
if (t) return Promise.reject(n);
|
|
@@ -1174,38 +1143,38 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
1174
1143
|
};
|
|
1175
1144
|
}
|
|
1176
1145
|
};
|
|
1177
|
-
var
|
|
1178
|
-
function
|
|
1179
|
-
return
|
|
1146
|
+
var _ = new B();
|
|
1147
|
+
function d(u3, e) {
|
|
1148
|
+
return _.parse(u3, e);
|
|
1180
1149
|
}
|
|
1181
|
-
|
|
1182
|
-
return
|
|
1150
|
+
d.options = d.setOptions = function(u3) {
|
|
1151
|
+
return _.setOptions(u3), d.defaults = _.defaults, Z(d.defaults), d;
|
|
1183
1152
|
};
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
return
|
|
1153
|
+
d.getDefaults = L;
|
|
1154
|
+
d.defaults = T;
|
|
1155
|
+
d.use = function(...u3) {
|
|
1156
|
+
return _.use(...u3), d.defaults = _.defaults, Z(d.defaults), d;
|
|
1188
1157
|
};
|
|
1189
|
-
|
|
1190
|
-
return
|
|
1158
|
+
d.walkTokens = function(u3, e) {
|
|
1159
|
+
return _.walkTokens(u3, e);
|
|
1191
1160
|
};
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
var
|
|
1203
|
-
var
|
|
1204
|
-
var
|
|
1205
|
-
var
|
|
1206
|
-
var
|
|
1207
|
-
var
|
|
1208
|
-
var
|
|
1161
|
+
d.parseInline = _.parseInline;
|
|
1162
|
+
d.Parser = b;
|
|
1163
|
+
d.parser = b.parse;
|
|
1164
|
+
d.Renderer = P;
|
|
1165
|
+
d.TextRenderer = $;
|
|
1166
|
+
d.Lexer = x;
|
|
1167
|
+
d.lexer = x.lex;
|
|
1168
|
+
d.Tokenizer = y;
|
|
1169
|
+
d.Hooks = S;
|
|
1170
|
+
d.parse = d;
|
|
1171
|
+
var Dt = d.options;
|
|
1172
|
+
var Ht = d.setOptions;
|
|
1173
|
+
var Zt = d.use;
|
|
1174
|
+
var Gt = d.walkTokens;
|
|
1175
|
+
var Nt = d.parseInline;
|
|
1176
|
+
var Ft = b.parse;
|
|
1177
|
+
var jt = x.lex;
|
|
1209
1178
|
|
|
1210
1179
|
// src/sidebar.js
|
|
1211
1180
|
var ChatSidebar = class extends HTMLElement {
|
|
@@ -1735,7 +1704,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
1735
1704
|
}
|
|
1736
1705
|
|
|
1737
1706
|
// src/chatbot.js
|
|
1738
|
-
|
|
1707
|
+
d.setOptions({
|
|
1739
1708
|
breaks: true,
|
|
1740
1709
|
gfm: true
|
|
1741
1710
|
});
|
|
@@ -2459,9 +2428,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
2459
2428
|
const decoder = new TextDecoder("utf-8");
|
|
2460
2429
|
let buffer = "";
|
|
2461
2430
|
let accumulatedAnswer = "";
|
|
2462
|
-
let lastStatusMessage = "";
|
|
2463
2431
|
let accumulatedImages = [];
|
|
2464
|
-
let historyAccumulatedImages = [];
|
|
2465
2432
|
let currentDisplayText = "";
|
|
2466
2433
|
let animationFrameId = null;
|
|
2467
2434
|
let lastRenderedLength = 0;
|
|
@@ -2499,7 +2466,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
2499
2466
|
}
|
|
2500
2467
|
const newText = data.text;
|
|
2501
2468
|
accumulatedAnswer += newText;
|
|
2502
|
-
const words = newText.split(" ");
|
|
2503
2469
|
if (!animationFrameId) {
|
|
2504
2470
|
let lastTime = performance.now();
|
|
2505
2471
|
const animate = (now) => {
|
|
@@ -2514,7 +2480,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
2514
2480
|
currentDisplayText = accumulatedAnswer.slice(0, lastRenderedLength);
|
|
2515
2481
|
const safeText = this.ensureClosedCodeBlock(currentDisplayText);
|
|
2516
2482
|
const cleanReply = this.fixMarkdown(safeText);
|
|
2517
|
-
contentDiv.innerHTML =
|
|
2483
|
+
contentDiv.innerHTML = d.parse(cleanReply);
|
|
2518
2484
|
}
|
|
2519
2485
|
if (lastRenderedLength < accumulatedAnswer.length) {
|
|
2520
2486
|
animationFrameId = requestAnimationFrame(animate);
|
|
@@ -2529,7 +2495,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
2529
2495
|
statusDiv.remove();
|
|
2530
2496
|
typingDiv.style.display = "none";
|
|
2531
2497
|
const cleanReply = this.fixMarkdown(accumulatedAnswer);
|
|
2532
|
-
const htmlReply =
|
|
2498
|
+
const htmlReply = d.parse(cleanReply);
|
|
2533
2499
|
contentDiv.innerHTML = htmlReply;
|
|
2534
2500
|
const images = accumulatedImages;
|
|
2535
2501
|
if (images?.length > 0) {
|
|
@@ -2736,7 +2702,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
2736
2702
|
const cleanReply = this.fixMarkdown(content);
|
|
2737
2703
|
const contentDiv = document.createElement("div");
|
|
2738
2704
|
contentDiv.className = "content";
|
|
2739
|
-
contentDiv.innerHTML =
|
|
2705
|
+
contentDiv.innerHTML = d.parse(cleanReply);
|
|
2740
2706
|
wrapper.appendChild(contentDiv);
|
|
2741
2707
|
} else {
|
|
2742
2708
|
wrapper.textContent = content;
|