" + katex.renderToString(latex, options) + "
"; } catch (error2) { if (options.throwOnError) { console.log(error2); } return `${escapeHtml2(latex)}
`; } }; var blockRenderer = function(tokens, idx) { return katexBlock(tokens[idx].content) + "\n"; }; md.inline.ruler.after("escape", "math_inline", math_inline); md.block.ruler.after("blockquote", "math_block", math_block, { alt: ["paragraph", "reference", "blockquote", "list"] }); md.renderer.rules.math_inline = inlineRenderer; md.renderer.rules.math_block = blockRenderer; }; } }); // ../../node_modules/.pnpm/html-to-md@0.8.8/node_modules/html-to-md/dist/index.js var require_dist = __commonJS({ "../../node_modules/.pnpm/html-to-md@0.8.8/node_modules/html-to-md/dist/index.js"(exports, module2) { !function(t2, e) { "object" === typeof exports && "object" === typeof module2 ? module2.exports = e() : "function" === typeof define && define.amd ? define([], e) : "object" === typeof exports ? exports.html2md = e() : t2.html2md = e(); }(exports, function() { return function(t2) { var e = {}; function r(n) { if (e[n]) return e[n].exports; var o = e[n] = { i: n, l: false, exports: {} }; return t2[n].call(o.exports, o, o.exports, r), o.l = true, o.exports; } return r.m = t2, r.c = e, r.d = function(t3, e2, n) { r.o(t3, e2) || Object.defineProperty(t3, e2, { enumerable: true, get: n }); }, r.r = function(t3) { "undefined" !== typeof Symbol && Symbol.toStringTag && Object.defineProperty(t3, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t3, "__esModule", { value: true }); }, r.t = function(t3, e2) { if (1 & e2 && (t3 = r(t3)), 8 & e2) return t3; if (4 & e2 && "object" === typeof t3 && t3 && t3.__esModule) return t3; var n = /* @__PURE__ */ Object.create(null); if (r.r(n), Object.defineProperty(n, "default", { enumerable: true, value: t3 }), 2 & e2 && "string" != typeof t3) for (var o in t3) r.d(n, o, function(e3) { return t3[e3]; }.bind(null, o)); return n; }, r.n = function(t3) { var e2 = t3 && t3.__esModule ? function() { return t3.default; } : function() { return t3; }; return r.d(e2, "a", e2), e2; }, r.o = function(t3, e2) { return Object.prototype.hasOwnProperty.call(t3, e2); }, r.p = "", r(r.s = 46); }([function(t2, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: true }); var n = r(1), o = r(12), i = r(6), a = r(7), c = r(2), u = function() { function t3(t4, e2, r2) { var o2 = void 0 === r2 ? {} : r2, i2 = o2.keepSpace, a2 = void 0 !== i2 && i2, c2 = o2.prevTagName, u2 = void 0 === c2 ? "" : c2, s = o2.nextTagName, p = void 0 === s ? "" : s, l = o2.prevTagStr, f = void 0 === l ? "" : l, h2 = o2.nextTagStr, d = void 0 === h2 ? "" : h2, _ = o2.parentTag, y = void 0 === _ ? "" : _, v = o2.isFirstSubTag, g = void 0 === v || v, b = o2.calcLeading, m = void 0 !== b && b, O = o2.leadingSpace, S = void 0 === O ? "" : O, T = o2.layer, x = void 0 === T ? 1 : T, j = o2.noWrap, w = void 0 !== j && j, P = o2.prevHasEndSpace, M = void 0 !== P && P, E = o2.prevHasStartSpace, N = void 0 !== E && E, C = o2.match, L = void 0 === C ? null : C, k = o2.indentSpace, A = void 0 === k ? "" : k, H = o2.language, W = void 0 === H ? "" : H, V = o2.count, R = void 0 === V ? 1 : V, I = o2.tableColumnCount, q = void 0 === I ? 0 : I, D = o2.noExtraLine, U = void 0 !== D && D, B = o2.inTable, F = void 0 !== B && B; if (this.tagName = e2, this.rawStr = t4, this.parentTag = y, this.prevTagName = u2, this.nextTagName = p, this.prevTagStr = f, this.nextTagStr = d, this.isFirstSubTag = g, this.calcLeading = m, this.leadingSpace = S, this.layer = x, this.noWrap = w, this.match = L, this.indentSpace = A, this.language = W, this.count = R, this.inTable = F, this.tableColumnCount = q, this.noExtraLine = U, this.prevHasEndSpace = M, this.prevHasStartSpace = N, this.hasStartSpace = false, this.hasEndSpace = false, this.keepSpace = a2, !this.__detectStr__(t4, this.tagName)) return this.attrs = {}, void (this.innerHTML = ""); var G = this.__fetchTagAttrAndInnerHTML__(t4), $2 = G.attr, J = G.innerHTML; J.startsWith(" ") && (0, n.isSpacePassingTag)(e2) && (this.hasStartSpace = true), J.endsWith(" ") && (0, n.isSpacePassingTag)(e2) && (this.hasEndSpace = true), this.attrs = $2, this.innerHTML = J; } return t3.prototype.__detectStr__ = function(t4, e2) { if ("<" !== t4[0]) return "Not a valid tag, current tag name: ".concat(this.tagName, ", tag content: ").concat(t4), false; for (var r2 = "", n2 = false, o2 = 1; o2 < t4.length && ">" !== t4[o2]; o2++) !n2 && /(\s|\/)/.test(t4[o2]) && (n2 = true), n2 || (r2 += t4[o2]); return r2 === e2; }, t3.prototype.__fetchTagAttrAndInnerHTML__ = function(t4) { for (var e2 = "", r2 = 1; r2 < t4.length && ">" !== t4[r2]; r2++) e2 += t4[r2]; for (var o2 = t4.slice(r2 + 1), i2 = "", a2 = -1, c2 = o2.length - 1; c2 >= 0; c2--) if ((i2 = o2[c2] + i2).startsWith("")) { i2.startsWith("" + this.tagName + ">") && (a2 = c2); break; } -1 === a2 && (0, n.isSelfClosing)(this.tagName) && this.tagName; var u2 = (0, n.getTagAttributes)(e2); return this.tagName && delete u2[this.tagName], { attr: u2, innerHTML: o2.slice(0, a2) }; }, t3.prototype.__onlyLeadingSpace__ = function(t4) { t4 = t4.trim(); for (var e2 = 0; e2 < t4.length; e2++) if (t4[e2] !== i.SINGLE) return false; return true; }, t3.prototype.__isEmpty__ = function(t4) { return !this.keepSpace && ("" === t4 && "td" !== this.tagName || this.calcLeading && this.__onlyLeadingSpace__(t4)); }, t3.prototype.getValidSubTagName = function(t4) { return t4; }, t3.prototype.beforeParse = function() { var t4 = c.default.get().tagListener; if (t4) { var e2 = t4(this.tagName, { parentTag: this.parentTag, prevTagName: this.prevTagName, nextTagName: this.nextTagName, isFirstSubTag: this.isFirstSubTag, attrs: this.attrs, innerHTML: this.innerHTML, language: this.language, match: this.match, isSelfClosing: false }), r2 = e2.attrs, n2 = e2.language, o2 = e2.match; this.attrs = r2, "string" === typeof n2 && (this.language = n2), "undefined" !== typeof o2 && (this.match = o2); } return ""; }, t3.prototype.parseValidSubTag = function(t4, e2, r2) { var o2 = new ((0, n.getTagConstructor)(e2))(t4, e2, r2); return [o2.exec(), o2]; }, t3.prototype.parseOnlyString = function(t4, e2, r2) { var n2 = new o.default(t4, e2, r2); return [n2.exec(), n2]; }, t3.prototype.afterParsed = function(t4) { return t4; }, t3.prototype.slim = function(t4) { return this.keepSpace ? t4 : t4.trim(); }, t3.prototype.beforeMergeSpace = function(t4) { return t4; }, t3.prototype.mergeSpace = function(t4, e2, r2) { return this.keepSpace && "pre" !== this.tagName ? t4.endsWith("\n") ? t4 : t4 + r2.replace(/\n+/g, "\n") : e2 + t4 + r2; }, t3.prototype.afterMergeSpace = function(t4) { return t4; }, t3.prototype.beforeReturn = function(t4) { return !((0, n.isSpacePassingTag)(this.prevTagName) && this.prevHasEndSpace || (0, n.isSpacePassingTag)(this.tagName) && this.hasStartSpace) || /^\s+/.test(t4) || /\s+$/.test(this.prevTagStr) ? t4 : " " + t4; }, t3.prototype.exec = function(t4, e2) { void 0 === t4 && (t4 = ""), void 0 === e2 && (e2 = ""); for (var r2 = this.beforeParse(), o2 = (0, n.generateGetNextValidTag)(this.innerHTML), i2 = o2(), c2 = i2[0], u2 = i2[1], s = null, p = false, l = false; "" !== u2; ) { var f, h2 = o2(), d = h2[0], _ = h2[1], y = { parentTag: this.tagName, nextTagName: d, nextTagStr: _, prevTagName: s, prevTagStr: r2, prevHasEndSpace: l, prevHasStartSpace: p, leadingSpace: this.leadingSpace, layer: this.layer, keepSpace: this.keepSpace, inTable: this.inTable, calcLeading: ("li" === this.tagName || "ol" === this.tagName || "ul" === this.tagName) && this.calcLeading }, v = void 0, g = void 0; if (null != c2) v = (f = this.parseValidSubTag(u2, c2, y))[0], g = f[1]; else v = (f = this.parseOnlyString(u2, c2, y))[0], g = f[1]; l = (null === g || void 0 === g ? void 0 : g.hasEndSpace) || false, p = (null === g || void 0 === g ? void 0 : g.hasStartSpace) || false; var b = this.getValidSubTagName(c2); c2 = d, u2 = _, null == b && this.__isEmpty__(v) || (!this.keepSpace && (0, a.default)(s) && (0, a.default)(b) && (r2 = r2.replace(/\n+$/, "\n"), v = v.replace(/^\n+/, "\n")), s = b, this.isFirstSubTag = false, r2 += v); } return r2 = this.afterParsed(r2), r2 = this.slim(r2), this.__isEmpty__(r2) ? "" : (r2 = this.beforeMergeSpace(r2), !this.noExtraLine && (0, a.default)(this.tagName) && this.prevTagName && !r2.startsWith("\n") && !(0, a.default)(this.prevTagName) && this.parentTag && (t4 = "\n\n"), r2 = this.mergeSpace(r2, t4, e2), this.noWrap && !this.keepSpace && (r2 = r2.replace(/\s+/g, " ")), r2 = this.afterMergeSpace(r2), r2 = this.beforeReturn(r2)); }, t3; }(); e.default = u; }, function(t2, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.isSpacePassingTag = e.isIndependentTag = e.clearComment = e.getLanguage = e.getTableAlign = e.getTagAttributes = e.isSelfClosing = e.generateGetNextValidTag = e.getTagConstructor = e.getRealTagName = e.unescapeStr = e.extraEscape = void 0; var n = r(18); Object.defineProperty(e, "extraEscape", { enumerable: true, get: function() { return n.extraEscape; } }), Object.defineProperty(e, "unescapeStr", { enumerable: true, get: function() { return n.unescapeStr; } }); var o = r(47); e.generateGetNextValidTag = o.default; var i = r(48); e.getTagConstructor = i.default; var a = r(11); e.isSelfClosing = a.default; var c = r(51); e.getTagAttributes = c.default; var u = r(52); e.getLanguage = u.default; var s = r(53); e.clearComment = s.default; var p = r(13); e.getRealTagName = p.default; var l = r(7); e.isIndependentTag = l.default; var f = r(54); e.isSpacePassingTag = f.default; var h2 = r(55); e.getTableAlign = h2.default; }, function(t2, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: true }); var n = function() { function t3(t4) { var e2 = void 0 === t4 ? {} : t4, r2 = e2.skipTags, n2 = void 0 === r2 ? [] : r2, o2 = e2.emptyTags, i2 = void 0 === o2 ? [] : o2, a = e2.ignoreTags, c = void 0 === a ? [] : a, u = e2.aliasTags, s = void 0 === u ? {} : u, p = e2.renderCustomTags, l = void 0 === p || p, f = e2.tagListener, h2 = void 0 === f ? function(t5, e3) { return e3; } : f; this.options = { skipTags: n2, emptyTags: i2, ignoreTags: c, aliasTags: s, renderCustomTags: l, tagListener: h2 }; } return t3.prototype.get = function() { return this.options; }, t3.prototype.clear = function() { this.options = {}; }, t3.prototype.set = function(t4, e2) { var r2 = this; t4 && "[object Object]" === Object.prototype.toString.call(t4) && Object.keys(t4).forEach(function(n2) { e2 ? r2.options[n2] = t4[n2] : function(t5, e3, r3) { if (!(r3 in t5)) return void (t5[r3] = e3[r3]); var n3 = Array.isArray(t5[r3]), o2 = "[object Object]" === Object.prototype.toString.call(t5[r3]); t5[r3] = n3 ? t5[r3].concat(e3[r3]) : o2 ? Object.assign(t5[r3], e3[r3]) : e3[r3]; }(r2.options, t4, n2); }); }, t3.prototype.reset = function() { this.options = JSON.parse(JSON.stringify(o)), this.options.tagListener = function(t4, e2) { return e2; }; }, t3; }(); var o = { ignoreTags: ["", "style", "head", "!doctype", "form", "svg", "noscript", "script", "meta"], skipTags: ["div", "html", "body", "nav", "section", "footer", "main", "aside", "article", "header"], emptyTags: [], aliasTags: { figure: "p", dl: "p", dd: "p", dt: "p", figcaption: "p" }, renderCustomTags: true }, i = new n(); i.reset(), e.default = i; }, function(t2, e, r) { "use strict"; var n = this && this.__extends || function() { var t3 = function(e2, r2) { return (t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e3) { t4.__proto__ = e3; } || function(t4, e3) { for (var r3 in e3) Object.prototype.hasOwnProperty.call(e3, r3) && (t4[r3] = e3[r3]); })(e2, r2); }; return function(e2, r2) { if ("function" !== typeof r2 && null !== r2) throw new TypeError("Class extends value " + String(r2) + " is not a constructor or null"); function n2() { this.constructor = e2; } t3(e2, r2), e2.prototype = null === r2 ? Object.create(r2) : (n2.prototype = r2.prototype, new n2()); }; }(); Object.defineProperty(e, "__esModule", { value: true }); var o = function(t3) { function e2(e3, r2) { void 0 === r2 && (r2 = "h1"); var n2 = t3.call(this, e3, r2) || this; return n2.match = "#", n2; } return n(e2, t3), e2.prototype.beforeMergeSpace = function(t4) { return this.match + " " + t4; }, e2.prototype.exec = function(e3, r2) { return e3 || (e3 = "\n"), r2 || (r2 = "\n"), t3.prototype.exec.call(this, e3, r2); }, e2; }(r(0).default); e.default = o; }, function(t2, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: true }); var n = r(1), o = r(2), i = function() { function t3(t4, e2, r2) { var n2 = void 0 === r2 ? {} : r2, o2 = n2.parentTag, i2 = void 0 === o2 ? "" : o2, a = n2.leadingSpace, c = void 0 === a ? "" : a, u = n2.layer, s = void 0 === u ? 1 : u, p = n2.isFirstSubTag, l = void 0 !== p && p, f = n2.inTable, h2 = void 0 !== f && f, d = n2.match, _ = void 0 === d ? null : d, y = n2.prevTagName, v = void 0 === y ? "" : y, g = n2.nextTagName, b = void 0 === g ? "" : g; if (this.tagName = e2, this.rawStr = t4, this.parentTag = i2, this.isFirstSubTag = l, this.prevTagName = v, this.nextTagName = b, this.leadingSpace = c, this.layer = s, this.innerHTML = "", this.match = _, this.inTable = h2, this.__detectStr__(t4, this.tagName)) { var m = this.__fetchTagAttr__(t4).attr; this.attrs = m; } else this.attrs = {}; } return t3.prototype.__detectStr__ = function(t4, e2) { if ("<" !== t4[0]) return "Not a valid tag, current tag name: ".concat(this.tagName, ", tag content: ").concat(t4), false; for (var r2 = "", n2 = false, o2 = 1; o2 < t4.length && ">" !== t4[o2]; o2++) !n2 && /(\s|\/)/.test(t4[o2]) && (n2 = true), n2 || (r2 += t4[o2]); return r2 === e2; }, t3.prototype.__fetchTagAttr__ = function(t4) { for (var e2 = "", r2 = 1; r2 < t4.length && ">" !== t4[r2]; r2++) e2 += t4[r2]; return { attr: (0, n.getTagAttributes)(e2) }; }, t3.prototype.beforeParse = function() { var t4 = o.default.get().tagListener; if (t4) { var e2 = t4(this.tagName, { parentTag: this.parentTag, prevTagName: this.prevTagName, nextTagName: this.nextTagName, isFirstSubTag: this.isFirstSubTag, attrs: this.attrs, innerHTML: this.innerHTML, match: this.match, isSelfClosing: true }), r2 = e2.attrs, n2 = e2.match; this.attrs = r2, this.match = n2; } return ""; }, t3.prototype.beforeMergeSpace = function(t4) { return t4; }, t3.prototype.afterMergeSpace = function(t4) { return t4; }, t3.prototype.beforeReturn = function(t4) { return t4; }, t3.prototype.exec = function(t4, e2) { void 0 === t4 && (t4 = ""), void 0 === e2 && (e2 = ""); var r2 = this.beforeParse(); return r2 = t4 + (r2 = this.beforeMergeSpace(r2)) + e2, r2 = this.afterMergeSpace(r2), r2 = this.beforeReturn(r2); }, t3; }(); e.default = i; }, function(t2, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: true }); var n = function() { function t3() { } return t3.prototype.exec = function() { return ""; }, t3; }(); e.default = n; }, function(t2, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.TRIPLE = e.DOUBLE = e.SINGLE = void 0; e.SINGLE = "\u2608"; e.DOUBLE = "\u2608\u2608"; e.TRIPLE = "\u2608\u2608\u2608"; }, function(t2, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: true }); var n = r(13), o = { html: true, body: true, p: true, div: true, pre: true, section: true, blockquote: true, aside: true, li: true, ul: true, ol: true, form: true, hr: true, h1: true, h2: true, h3: true, h4: true, h5: true, h6: true, dl: true, dd: true, dt: true, br: true, table: true }; e.default = function(t3) { if (!t3) return false; var e2 = (0, n.default)(t3); return !!e2 && !!o[e2]; }; }, function(t2, e, r) { "use strict"; var n = this && this.__extends || function() { var t3 = function(e2, r2) { return (t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e3) { t4.__proto__ = e3; } || function(t4, e3) { for (var r3 in e3) Object.prototype.hasOwnProperty.call(e3, r3) && (t4[r3] = e3[r3]); })(e2, r2); }; return function(e2, r2) { if ("function" !== typeof r2 && null !== r2) throw new TypeError("Class extends value " + String(r2) + " is not a constructor or null"); function n2() { this.constructor = e2; } t3(e2, r2), e2.prototype = null === r2 ? Object.create(r2) : (n2.prototype = r2.prototype, new n2()); }; }(), o = this && this.__assign || function() { return (o = Object.assign || function(t3) { for (var e2, r2 = 1, n2 = arguments.length; r2 < n2; r2++) for (var o2 in e2 = arguments[r2]) Object.prototype.hasOwnProperty.call(e2, o2) && (t3[o2] = e2[o2]); return t3; }).apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: true }), e.__EmptySelfClose__ = e.__Empty__ = void 0; var i = r(0), a = r(4), c = function(t3) { function e2(e3, r2, n2) { return void 0 === r2 && (r2 = "__empty__"), t3.call(this, e3, r2, n2) || this; } return n(e2, t3), e2.prototype.slim = function(t4) { return t4; }, e2.prototype.parseValidSubTag = function(r2, n2, i2) { if ("__skip__" === this.tagName) return t3.prototype.parseValidSubTag.call(this, r2, n2, i2); var a2 = new e2(r2, n2, o({}, i2)); return [a2.exec(), a2]; }, e2.prototype.parseOnlyString = function(e3, r2, n2) { return "__skip__" === this.tagName ? t3.prototype.parseOnlyString.call(this, e3, r2, n2) : [e3, null]; }, e2.prototype.exec = function() { return t3.prototype.exec.call(this, "", ""); }, e2; }(i.default); e.__Empty__ = c; var u = function(t3) { function e2(e3, r2) { void 0 === r2 && (r2 = "__emptyselfclose__"); var n2 = t3.call(this, e3, r2) || this; return n2.tagName = r2, n2; } return n(e2, t3), e2.prototype.exec = function() { return t3.prototype.exec.call(this, "", ""); }, e2; }(a.default); e.__EmptySelfClose__ = u; }, function(t2, e, r) { "use strict"; var n = this && this.__extends || function() { var t3 = function(e2, r2) { return (t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e3) { t4.__proto__ = e3; } || function(t4, e3) { for (var r3 in e3) Object.prototype.hasOwnProperty.call(e3, r3) && (t4[r3] = e3[r3]); })(e2, r2); }; return function(e2, r2) { if ("function" !== typeof r2 && null !== r2) throw new TypeError("Class extends value " + String(r2) + " is not a constructor or null"); function n2() { this.constructor = e2; } t3(e2, r2), e2.prototype = null === r2 ? Object.create(r2) : (n2.prototype = r2.prototype, new n2()); }; }(); Object.defineProperty(e, "__esModule", { value: true }), e.__SkipSelfClose__ = e.__Skip__ = void 0; var o = r(0), i = r(4), a = r(1), c = function(t3) { function e2(e3, r2, n2) { void 0 === r2 && (r2 = "__skip__"); var o2 = t3.call(this, e3, r2, n2) || this; return o2.noNeedWrap = ["td", "th"], o2; } return n(e2, t3), e2.prototype.exec = function() { var e3 = (0, a.isIndependentTag)((0, a.getRealTagName)(this.tagName)) && (!this.parentTag || !this.noNeedWrap.includes(this.parentTag)), r2 = e3 ? "\n" : "", n2 = e3 ? "\n" : ""; return t3.prototype.exec.call(this, r2, n2); }, e2; }(o.default); e.__Skip__ = c; var u = function(t3) { function e2(e3, r2, n2) { return void 0 === r2 && (r2 = "__skipselfclose__"), t3.call(this, e3, r2, n2) || this; } return n(e2, t3), e2.prototype.exec = function() { return ""; }, e2; }(i.default); e.__SkipSelfClose__ = u; }, function(t2, e, r) { "use strict"; var n = this && this.__extends || function() { var t3 = function(e2, r2) { return (t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e3) { t4.__proto__ = e3; } || function(t4, e3) { for (var r3 in e3) Object.prototype.hasOwnProperty.call(e3, r3) && (t4[r3] = e3[r3]); })(e2, r2); }; return function(e2, r2) { if ("function" !== typeof r2 && null !== r2) throw new TypeError("Class extends value " + String(r2) + " is not a constructor or null"); function n2() { this.constructor = e2; } t3(e2, r2), e2.prototype = null === r2 ? Object.create(r2) : (n2.prototype = r2.prototype, new n2()); }; }(); Object.defineProperty(e, "__esModule", { value: true }), e.__NoMatchSelfClose__ = e.__NoMatch__ = void 0; var o = r(0), i = r(4), a = function(t3) { function e2(e3, r2) { return void 0 === r2 && (r2 = "__nomatch__"), t3.call(this, e3, r2) || this; } return n(e2, t3), e2.prototype.beforeMergeSpace = function(t4) { return "<".concat(this.tagName, ">").concat(t4, "").concat(this.tagName, ">"); }, e2.prototype.exec = function() { return t3.prototype.exec.call(this, "", ""); }, e2; }(o.default); e.__NoMatch__ = a; var c = function(t3) { function e2(e3, r2) { return void 0 === r2 && (r2 = "__nomatchselfclose__"), t3.call(this, e3, r2) || this; } return n(e2, t3), e2.prototype.exec = function() { return "<".concat(this.tagName, " />"); }, e2; }(i.default); e.__NoMatchSelfClose__ = c; }, function(t2, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: true }); var n = { img: true, hr: true, input: true, br: true, meta: true, link: true, "!doctype": true, base: true, col: true, area: true, param: true, object: true, embed: true, keygen: true, source: true }; e.default = function(t3) { return null != t3 && !!n[t3.toLowerCase()]; }; }, function(t2, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: true }); var n = r(1), o = r(7), i = function() { function t3(t4, e2, r2) { void 0 === e2 && (e2 = "__nomatch__"); var n2 = void 0 === r2 ? {} : r2, o2 = n2.keepSpace, i2 = void 0 !== o2 && o2, a = n2.prevTagName, c = void 0 === a ? "" : a, u = n2.nextTagName, s = void 0 === u ? "" : u, p = n2.prevTagStr, l = void 0 === p ? "" : p, f = n2.prevHasEndSpace, h2 = void 0 !== f && f, d = n2.prevHasStartSpace, _ = void 0 !== d && d, y = n2.parentTag, v = void 0 === y ? "" : y, g = n2.calcLeading, b = void 0 !== g && g, m = n2.layer, O = void 0 === m ? 1 : m, S = n2.leadingSpace, T = void 0 === S ? "" : S, x = n2.inTable, j = void 0 !== x && x; this.tagName = e2, this.nextTagName = s, this.prevTagName = c, this.parentTag = v, this.prevTagStr = l, this.keepSpace = i2, this.calcLeading = b, this.leadingSpace = T, this.layer = O, this.rawStr = t4, this.inTable = j, this.prevHasEndSpace = h2, this.prevHasStartSpace = _, this.hasEndSpace = false, this.hasStartSpace = false, t4.startsWith(" ") && (this.hasStartSpace = true), t4.endsWith(" ") && (this.hasEndSpace = true); } return t3.prototype.slim = function(t4) { if (this.keepSpace) return t4; var e2 = t4.replace(/\s+/g, " "); return (0, o.default)(this.prevTagName) && (e2 = e2.trimLeft()), (0, o.default)(this.nextTagName) && (e2 = e2.trimRight()), e2; }, t3.prototype.beforeReturn = function(t4) { if (this.keepSpace) return t4; if (this.calcLeading) return this.leadingSpace + (0, n.extraEscape)(t4); var e2 = (0, n.extraEscape)(t4); return this.inTable && (e2 = e2.replace(/\|/g, "\\|")), this.prevTagName, this.prevHasEndSpace, this.prevTagStr, (0, n.isSpacePassingTag)(this.prevTagName) && this.prevHasEndSpace && !/^\s+/.test(t4) && !/\s+$/.test(this.prevTagStr) ? " " + t4 : e2; }, t3.prototype.exec = function() { var t4 = this.rawStr; return t4 = this.slim(t4), t4 = this.beforeReturn(t4); }, t3; }(); e.default = i; }, function(t2, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: true }); var n = r(2); e.default = function(t3) { if (!t3) return t3; var e2 = n.default.get().aliasTags; return null != (null === e2 || void 0 === e2 ? void 0 : e2[t3]) ? e2[t3] : t3; }; }, function(t2, e, r) { "use strict"; var n = this && this.__extends || function() { var t3 = function(e2, r2) { return (t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e3) { t4.__proto__ = e3; } || function(t4, e3) { for (var r3 in e3) Object.prototype.hasOwnProperty.call(e3, r3) && (t4[r3] = e3[r3]); })(e2, r2); }; return function(e2, r2) { if ("function" !== typeof r2 && null !== r2) throw new TypeError("Class extends value " + String(r2) + " is not a constructor or null"); function n2() { this.constructor = e2; } t3(e2, r2), e2.prototype = null === r2 ? Object.create(r2) : (n2.prototype = r2.prototype, new n2()); }; }(); Object.defineProperty(e, "__esModule", { value: true }); var o = function(t3) { function e2(e3, r2, n2) { void 0 === r2 && (r2 = "strong"); var o2 = t3.call(this, e3, r2, n2) || this; return o2.layer = 1, o2.match = o2.match || "**", o2; } return n(e2, t3), e2.prototype.beforeMergeSpace = function(t4) { return this.match + t4 + this.match; }, e2.prototype.exec = function(e3, r2) { return void 0 === e3 && (e3 = ""), void 0 === r2 && (r2 = ""), null != this.match && this.prevTagStr && !this.prevTagStr.endsWith("\\" + this.match[0]) && this.prevTagStr.endsWith(this.match[0]) && (e3 = " "), t3.prototype.exec.call(this, e3, r2); }, e2; }(r(0).default); e.default = o; }, function(t2, e, r) { "use strict"; var n = this && this.__extends || function() { var t3 = function(e2, r2) { return (t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e3) { t4.__proto__ = e3; } || function(t4, e3) { for (var r3 in e3) Object.prototype.hasOwnProperty.call(e3, r3) && (t4[r3] = e3[r3]); })(e2, r2); }; return function(e2, r2) { if ("function" !== typeof r2 && null !== r2) throw new TypeError("Class extends value " + String(r2) + " is not a constructor or null"); function n2() { this.constructor = e2; } t3(e2, r2), e2.prototype = null === r2 ? Object.create(r2) : (n2.prototype = r2.prototype, new n2()); }; }(); Object.defineProperty(e, "__esModule", { value: true }); var o = function(t3) { function e2(e3, r2) { void 0 === r2 && (r2 = "del"); var n2 = t3.call(this, e3, r2) || this; return n2.match = n2.match || "~~", n2; } return n(e2, t3), e2.prototype.beforeMergeSpace = function(t4) { return this.match + t4 + this.match; }, e2.prototype.exec = function(e3, r2) { return void 0 === e3 && (e3 = ""), void 0 === r2 && (r2 = ""), t3.prototype.exec.call(this, e3, r2); }, e2; }(r(0).default); e.default = o; }, function(t2, e, r) { "use strict"; var n = this && this.__extends || function() { var t3 = function(e2, r2) { return (t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e3) { t4.__proto__ = e3; } || function(t4, e3) { for (var r3 in e3) Object.prototype.hasOwnProperty.call(e3, r3) && (t4[r3] = e3[r3]); })(e2, r2); }; return function(e2, r2) { if ("function" !== typeof r2 && null !== r2) throw new TypeError("Class extends value " + String(r2) + " is not a constructor or null"); function n2() { this.constructor = e2; } t3(e2, r2), e2.prototype = null === r2 ? Object.create(r2) : (n2.prototype = r2.prototype, new n2()); }; }(); Object.defineProperty(e, "__esModule", { value: true }); var o = function(t3) { function e2(e3, r2, n2) { void 0 === r2 && (r2 = "em"); var o2 = t3.call(this, e3, r2, n2) || this; return o2.match = o2.match || "*", o2; } return n(e2, t3), e2.prototype.beforeMergeSpace = function(t4) { return this.match + t4 + this.match; }, e2.prototype.exec = function(e3, r2) { return void 0 === e3 && (e3 = ""), void 0 === r2 && (r2 = ""), "strong" === this.parentTag && this.nextTagStr && (r2 = " "), null != this.match && this.prevTagStr && !this.prevTagStr.endsWith("\\" + this.match) && this.prevTagStr.endsWith(this.match) && (e3 = " "), t3.prototype.exec.call(this, e3, r2); }, e2; }(r(0).default); e.default = o; }, function(t2, e, r) { "use strict"; var n = this && this.__extends || function() { var t3 = function(e2, r2) { return (t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e3) { t4.__proto__ = e3; } || function(t4, e3) { for (var r3 in e3) Object.prototype.hasOwnProperty.call(e3, r3) && (t4[r3] = e3[r3]); })(e2, r2); }; return function(e2, r2) { if ("function" !== typeof r2 && null !== r2) throw new TypeError("Class extends value " + String(r2) + " is not a constructor or null"); function n2() { this.constructor = e2; } t3(e2, r2), e2.prototype = null === r2 ? Object.create(r2) : (n2.prototype = r2.prototype, new n2()); }; }(); Object.defineProperty(e, "__esModule", { value: true }); var o = function(t3) { function e2(e3, r2, n2) { void 0 === r2 && (r2 = "th"); var o2 = t3.call(this, e3, r2, n2) || this; return o2.tagName = r2, o2; } return n(e2, t3), e2.prototype.beforeMergeSpace = function(t4) { return t4 + "|"; }, e2.prototype.parseValidSubTag = function(e3, r2, n2) { return "ul" === r2 || "ol" === r2 || "table" === r2 || "pre" === r2 ? [e3.replace(/([\n\r])/g, ""), null] : t3.prototype.parseValidSubTag.call(this, e3, r2, n2); }, e2.prototype.exec = function(e3, r2) { return void 0 === e3 && (e3 = ""), void 0 === r2 && (r2 = ""), t3.prototype.exec.call(this, e3, r2); }, e2; }(r(0).default); e.default = o; }, function(t2, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.unescapeStr = e.extraEscape = e.escapeStr = void 0; var n = { "&": "&", "<": "<", ">": ">", """: '"', "'": "'", "'": "'", "`": "`", "“": "\u201C", "”": "\u201D" }, o = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "`": "`", "\u201C": "“", "\u201D": "”" }, i = /[&<>"'`\u201c\u201d]/g, a = RegExp(i.source), c = /&(?:amp|lt|gt|quot|#39|apos|#x60|ldquo|rdquo);/g, u = RegExp(c.source), s = [[/\\/g, "\\\\"], [/\*/g, "\\*"], [/^-/g, "\\-"], [/^\+ /g, "\\+ "], [/^(=+)/g, "\\$1"], [/^(#{1,6}) /g, "\\$1 "], [/`/g, "\\`"], [/^~~~/g, "\\~~~"], [/\[/g, "\\["], [/\]/g, "\\]"], [/^>/g, "\\>"], [/_/g, "\\_"], [/^(\d+)\. /g, "$1\\. "]]; e.escapeStr = function(t3) { return t3 && a.test(t3) ? t3.replace(i, function(t4) { return o[t4]; }) : t3; }, e.unescapeStr = function(t3) { return t3 = t3 && u.test(t3) ? t3.replace(c, function(t4) { return n[t4]; }) : t3; }, e.extraEscape = function(t3) { return s.reduce(function(t4, e2) { return t4.replace(e2[0], e2[1]); }, t3); }; }, function(t2, e, r) { "use strict"; var n = this && this.__extends || function() { var t3 = function(e2, r2) { return (t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e3) { t4.__proto__ = e3; } || function(t4, e3) { for (var r3 in e3) Object.prototype.hasOwnProperty.call(e3, r3) && (t4[r3] = e3[r3]); })(e2, r2); }; return function(e2, r2) { if ("function" !== typeof r2 && null !== r2) throw new TypeError("Class extends value " + String(r2) + " is not a constructor or null"); function n2() { this.constructor = e2; } t3(e2, r2), e2.prototype = null === r2 ? Object.create(r2) : (n2.prototype = r2.prototype, new n2()); }; }(); Object.defineProperty(e, "__esModule", { value: true }); var o = function(t3) { function e2(e3, r2, n2) { return void 0 === r2 && (r2 = "a"), t3.call(this, e3, r2, n2) || this; } return n(e2, t3), e2.prototype.beforeMergeSpace = function(t4) { var e3 = this.attrs, r2 = e3.href, n2 = e3.title, o2 = r2 || ""; return n2 ? "[".concat(t4, "](").concat(o2, ' "').concat(n2, '")') : "[".concat(t4, "](").concat(o2, ")"); }, e2.prototype.parseOnlyString = function(e3, r2, n2) { return "tbody" === this.parentTag || "thead" === this.parentTag ? [e3, null] : t3.prototype.parseOnlyString.call(this, e3, r2, n2); }, e2.prototype.exec = function(e3, r2) { return void 0 === e3 && (e3 = ""), void 0 === r2 && (r2 = ""), t3.prototype.exec.call(this, e3, r2); }, e2; }(r(0).default); e.default = o; }, function(t2, e, r) { "use strict"; var n = this && this.__extends || function() { var t3 = function(e2, r2) { return (t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e3) { t4.__proto__ = e3; } || function(t4, e3) { for (var r3 in e3) Object.prototype.hasOwnProperty.call(e3, r3) && (t4[r3] = e3[r3]); })(e2, r2); }; return function(e2, r2) { if ("function" !== typeof r2 && null !== r2) throw new TypeError("Class extends value " + String(r2) + " is not a constructor or null"); function n2() { this.constructor = e2; } t3(e2, r2), e2.prototype = null === r2 ? Object.create(r2) : (n2.prototype = r2.prototype, new n2()); }; }(); Object.defineProperty(e, "__esModule", { value: true }); var o = function(t3) { function e2(e3, r2, n2) { return void 0 === r2 && (r2 = "b"), t3.call(this, e3, r2, n2) || this; } return n(e2, t3), e2.prototype.exec = function(e3, r2) { return t3.prototype.exec.call(this, e3, r2); }, e2; }(r(14).default); e.default = o; }, function(t2, e, r) { "use strict"; var n = this && this.__extends || function() { var t3 = function(e2, r2) { return (t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e3) { t4.__proto__ = e3; } || function(t4, e3) { for (var r3 in e3) Object.prototype.hasOwnProperty.call(e3, r3) && (t4[r3] = e3[r3]); })(e2, r2); }; return function(e2, r2) { if ("function" !== typeof r2 && null !== r2) throw new TypeError("Class extends value " + String(r2) + " is not a constructor or null"); function n2() { this.constructor = e2; } t3(e2, r2), e2.prototype = null === r2 ? Object.create(r2) : (n2.prototype = r2.prototype, new n2()); }; }(), o = this && this.__assign || function() { return (o = Object.assign || function(t3) { for (var e2, r2 = 1, n2 = arguments.length; r2 < n2; r2++) for (var o2 in e2 = arguments[r2]) Object.prototype.hasOwnProperty.call(e2, o2) && (t3[o2] = e2[o2]); return t3; }).apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: true }); var i = r(7), a = r(0), c = r(1), u = function(t3) { function e2(e3, r2, n2) { void 0 === r2 && (r2 = "blockquote"); var o2 = t3.call(this, e3, r2, n2) || this; return o2.match = o2.match || ">", o2.fillPerLine = o2.fillPerLine.bind(o2), o2; } return n(e2, t3), e2.prototype.beforeMergeSpace = function(t4) { if ("" === t4.trim()) return ""; var e3 = this.match + " " + t4; return this.calcLeading ? this.leadingSpace + e3 : e3; }, e2.prototype.afterMergeSpace = function(t4) { for (var e3 = this, r2 = t4.split("\n"), n2 = r2.length - 1; n2 >= 0; n2--) n2 < r2.length - 1 && ">" === r2[n2].trim() && ">" === r2[n2 + 1].trim() && r2.splice(n2, 1); return (r2 = r2.map(function(t5) { return "" === t5 ? "" : e3.fillPerLine(t5); })).join("\n"); }, e2.prototype.beforeReturn = function(t4) { return t4.replace("\n\n", "\n"); }, e2.prototype.fillPerLine = function(t4) { var e3 = ">"; if (this.calcLeading && (e3 = this.leadingSpace + ">"), !t4.startsWith(e3)) { var r2 = this.match + " " + t4; return this.calcLeading ? this.leadingSpace + r2 : r2; } return t4; }, e2.prototype.parseValidSubTag = function(t4, e3, r2) { var n2; "blockquote" === e3 ? n2 = new ((0, c.getTagConstructor)(e3))(t4, e3, o(o({}, r2), { calcLeading: this.calcLeading, match: this.match + ">", noExtraLine: true })) : n2 = new ((0, c.getTagConstructor)(e3))(t4, e3, o(o({}, r2), { noExtraLine: true })); var a2 = n2.exec(), u2 = ""; this.calcLeading && (u2 = this.leadingSpace); var s = (0, i.default)(r2.prevTagName) && "br" !== r2.prevTagName, p = (0, i.default)(r2.nextTagName) && "br" !== r2.nextTagName, l = (0, i.default)(e3) && "br" !== e3; return this.isFirstSubTag ? [a2.trimLeft().replace(u2, ""), n2] : l ? (a2 = u2 + this.match + a2, s || (a2 = "\n" + a2), !p && r2.nextTagStr && r2.nextTagStr.trim() && (a2 += this.match + "\n"), [a2, n2]) : s ? [u2 + this.match + "\n" + a2, n2] : [a2, n2]; }, e2.prototype.exec = function(e3, r2) { return void 0 === e3 && (e3 = "\n"), void 0 === r2 && (r2 = "\n"), t3.prototype.exec.call(this, e3, r2); }, e2; }(a.default); e.default = u; }, function(t2, e, r) { "use strict"; var n = this && this.__extends || function() { var t3 = function(e2, r2) { return (t3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t4, e3) { t4.__proto__ = e3; } || function(t4, e3) { for (var r3 in e3) Object.prototype.hasOwnProperty.call(e3, r3) && (t4[r3] = e3[r3]); })(e2, r2); }; return function(e2, r2) { if ("function" !== typeof r2 && null !== r2) throw new TypeError("Class extends value " + String(r2) + " is not a constructor or null"); function n2() { this.constructor = e2; } t3(e2, r2), e2.prototype = null === r2 ? Object.create(r2) : (n2.prototype = r2.prototype, new n2()); }; }(); Object.defineProperty(e, "__esModule", { value: true }); var o = r(4), i = r(18), a = function(t3) { function e2(e3, r2, n2) { return void 0 === r2 && (r2 = "b"), t3.call(this, e3, r2, n2) || this; } return n(e2, t3), e2.prototype.exec = function(t4, e3) { return void 0 === e3 && (e3 = "\n"), this.inTable ? (0, i.escapeStr)("${content.replace(/ /g, " ").split("\n").join("
")}
" + escapeHtml(token.content) + "";
};
default_rules.code_block = function(tokens, idx, options, env, slf) {
const token = tokens[idx];
return "" + escapeHtml(tokens[idx].content) + "\n";
};
default_rules.fence = function(tokens, idx, options, env, slf) {
const token = tokens[idx];
const info = token.info ? unescapeAll(token.info).trim() : "";
let langName = "";
let langAttrs = "";
if (info) {
const arr = info.split(/(\s+)/g);
langName = arr[0];
langAttrs = arr.slice(2).join("");
}
let highlighted;
if (options.highlight) {
highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content);
} else {
highlighted = escapeHtml(token.content);
}
if (highlighted.indexOf("${highlighted}
`;
}
return `${highlighted}
`;
};
default_rules.image = function(tokens, idx, options, env, slf) {
const token = tokens[idx];
token.attrs[token.attrIndex("alt")][1] = slf.renderInlineAsText(token.children, options, env);
return slf.renderToken(tokens, idx, options);
};
default_rules.hardbreak = function(tokens, idx, options) {
return options.xhtmlOut ? "