!(function (e, t) {
"object" == typeof exports && "undefined" != typeof module
? (module.exports = t())
: "function" == typeof define && define.amd
? define(t)
: ((e =
"undefined" != typeof globalThis
? globalThis
: e || self).RevealMarkdown = t());
})(this, function () {
"use strict";
function e() {
return {
baseUrl: null,
breaks: !1,
extensions: null,
gfm: !0,
headerIds: !0,
headerPrefix: "",
highlight: null,
langPrefix: "language-",
mangle: !0,
pedantic: !1,
renderer: null,
sanitize: !1,
sanitizer: null,
silent: !1,
smartLists: !1,
smartypants: !1,
tokenizer: null,
walkTokens: null,
xhtml: !1,
};
}
let t = {
baseUrl: null,
breaks: !1,
extensions: null,
gfm: !0,
headerIds: !0,
headerPrefix: "",
highlight: null,
langPrefix: "language-",
mangle: !0,
pedantic: !1,
renderer: null,
sanitize: !1,
sanitizer: null,
silent: !1,
smartLists: !1,
smartypants: !1,
tokenizer: null,
walkTokens: null,
xhtml: !1,
};
const n = /[&<>"']/,
r = /[&<>"']/g,
s = /[<>"']|&(?!#?\w+;)/,
i = /[<>"']|&(?!#?\w+;)/g,
l = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" },
a = (e) => l[e];
function o(e, t) {
if (t) {
if (n.test(e)) return e.replace(r, a);
} else if (s.test(e)) return e.replace(i, a);
return e;
}
const c = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;
function h(e) {
return e.replace(c, (e, t) =>
"colon" === (t = t.toLowerCase())
? ":"
: "#" === t.charAt(0)
? "x" === t.charAt(1)
? String.fromCharCode(parseInt(t.substring(2), 16))
: String.fromCharCode(+t.substring(1))
: ""
);
}
const p = /(^|[^\[])\^/g;
function u(e, t) {
(e = e.source || e), (t = t || "");
const n = {
replace: (t, r) => (
(r = (r = r.source || r).replace(p, "$1")), (e = e.replace(t, r)), n
),
getRegex: () => new RegExp(e, t),
};
return n;
}
const g = /[^\w:]/g,
d = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
function f(e, t, n) {
if (e) {
let e;
try {
e = decodeURIComponent(h(n)).replace(g, "").toLowerCase();
} catch (e) {
return null;
}
if (
0 === e.indexOf("javascript:") ||
0 === e.indexOf("vbscript:") ||
0 === e.indexOf("data:")
)
return null;
}
t &&
!d.test(n) &&
(n = (function (e, t) {
k[" " + e] ||
(x.test(e) ? (k[" " + e] = e + "/") : (k[" " + e] = z(e, "/", !0)));
e = k[" " + e];
const n = -1 === e.indexOf(":");
return "//" === t.substring(0, 2)
? n
? t
: e.replace(m, "$1") + t
: "/" === t.charAt(0)
? n
? t
: e.replace(b, "$1") + t
: e + t;
})(t, n));
try {
n = encodeURI(n).replace(/%25/g, "%");
} catch (e) {
return null;
}
return n;
}
const k = {},
x = /^[^:]+:\/*[^/]*$/,
m = /^([^:]+:)[\s\S]*$/,
b = /^([^:]+:\/*[^/]*)[\s\S]*$/;
const w = { exec: function () {} };
function y(e) {
let t,
n,
r = 1;
for (; r < arguments.length; r++)
for (n in ((t = arguments[r]), t))
Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
return e;
}
function _(e, t) {
const n = e
.replace(/\|/g, (e, t, n) => {
let r = !1,
s = t;
for (; --s >= 0 && "\\" === n[s]; ) r = !r;
return r ? "|" : " |";
})
.split(/ \|/);
let r = 0;
if (
(n[0].trim() || n.shift(),
n.length > 0 && !n[n.length - 1].trim() && n.pop(),
n.length > t)
)
n.splice(t);
else for (; n.length < t; ) n.push("");
for (; r < n.length; r++) n[r] = n[r].trim().replace(/\\\|/g, "|");
return n;
}
function z(e, t, n) {
const r = e.length;
if (0 === r) return "";
let s = 0;
for (; s < r; ) {
const i = e.charAt(r - s - 1);
if (i !== t || n) {
if (i === t || !n) break;
s++;
} else s++;
}
return e.substr(0, r - s);
}
function S(e) {
e &&
e.sanitize &&
!e.silent &&
console.warn(
"marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options"
);
}
function $(e, t) {
if (t < 1) return "";
let n = "";
for (; t > 1; ) 1 & t && (n += e), (t >>= 1), (e += e);
return n + e;
}
function T(e, t, n, r) {
const s = t.href,
i = t.title ? o(t.title) : null,
l = e[1].replace(/\\([\[\]])/g, "$1");
if ("!" !== e[0].charAt(0)) {
r.state.inLink = !0;
const e = {
type: "link",
raw: n,
href: s,
title: i,
text: l,
tokens: r.inlineTokens(l, []),
};
return (r.state.inLink = !1), e;
}
return { type: "image", raw: n, href: s, title: i, text: o(l) };
}
class A {
constructor(e) {
this.options = e || t;
}
space(e) {
const t = this.rules.block.newline.exec(e);
if (t && t[0].length > 0) return { type: "space", raw: t[0] };
}
code(e) {
const t = this.rules.block.code.exec(e);
if (t) {
const e = t[0].replace(/^ {1,4}/gm, "");
return {
type: "code",
raw: t[0],
codeBlockStyle: "indented",
text: this.options.pedantic ? e : z(e, "\n"),
};
}
}
fences(e) {
const t = this.rules.block.fences.exec(e);
if (t) {
const e = t[0],
n = (function (e, t) {
const n = e.match(/^(\s+)(?:```)/);
if (null === n) return t;
const r = n[1];
return t
.split("\n")
.map((e) => {
const t = e.match(/^\s+/);
if (null === t) return e;
const [n] = t;
return n.length >= r.length ? e.slice(r.length) : e;
})
.join("\n");
})(e, t[3] || "");
return {
type: "code",
raw: e,
lang: t[2] ? t[2].trim() : t[2],
text: n,
};
}
}
heading(e) {
const t = this.rules.block.heading.exec(e);
if (t) {
let e = t[2].trim();
if (/#$/.test(e)) {
const t = z(e, "#");
this.options.pedantic
? (e = t.trim())
: (t && !/ $/.test(t)) || (e = t.trim());
}
const n = {
type: "heading",
raw: t[0],
depth: t[1].length,
text: e,
tokens: [],
};
return this.lexer.inline(n.text, n.tokens), n;
}
}
hr(e) {
const t = this.rules.block.hr.exec(e);
if (t) return { type: "hr", raw: t[0] };
}
blockquote(e) {
const t = this.rules.block.blockquote.exec(e);
if (t) {
const e = t[0].replace(/^ *> ?/gm, "");
return {
type: "blockquote",
raw: t[0],
tokens: this.lexer.blockTokens(e, []),
text: e,
};
}
}
list(e) {
let t = this.rules.block.list.exec(e);
if (t) {
let n,
r,
s,
i,
l,
a,
o,
c,
h,
p,
u,
g,
d = t[1].trim();
const f = d.length > 1,
k = {
type: "list",
raw: "",
ordered: f,
start: f ? +d.slice(0, -1) : "",
loose: !1,
items: [],
};
(d = f ? `\\d{1,9}\\${d.slice(-1)}` : `\\${d}`),
this.options.pedantic && (d = f ? d : "[*+-]");
const x = new RegExp(`^( {0,3}${d})((?: [^\\n]*)?(?:\\n|$))`);
for (
;
e && ((g = !1), (t = x.exec(e))) && !this.rules.block.hr.test(e);
) {
if (
((n = t[0]),
(e = e.substring(n.length)),
(c = t[2].split("\n", 1)[0]),
(h = e.split("\n", 1)[0]),
this.options.pedantic
? ((i = 2), (u = c.trimLeft()))
: ((i = t[2].search(/[^ ]/)),
(i = i > 4 ? 1 : i),
(u = c.slice(i)),
(i += t[1].length)),
(a = !1),
!c &&
/^ *$/.test(h) &&
((n += h + "\n"), (e = e.substring(h.length + 1)), (g = !0)),
!g)
) {
const t = new RegExp(
`^ {0,${Math.min(3, i - 1)}}(?:[*+-]|\\d{1,9}[.)])`
);
for (
;
e &&
((p = e.split("\n", 1)[0]),
(c = p),
this.options.pedantic &&
(c = c.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")),
!t.test(c));
) {
if (c.search(/[^ ]/) >= i || !c.trim()) u += "\n" + c.slice(i);
else {
if (a) break;
u += "\n" + c;
}
a || c.trim() || (a = !0),
(n += p + "\n"),
(e = e.substring(p.length + 1));
}
}
k.loose || (o ? (k.loose = !0) : /\n *\n *$/.test(n) && (o = !0)),
this.options.gfm &&
((r = /^\[[ xX]\] /.exec(u)),
r &&
((s = "[ ] " !== r[0]), (u = u.replace(/^\[[ xX]\] +/, "")))),
k.items.push({
type: "list_item",
raw: n,
task: !!r,
checked: s,
loose: !1,
text: u,
}),
(k.raw += n);
}
(k.items[k.items.length - 1].raw = n.trimRight()),
(k.items[k.items.length - 1].text = u.trimRight()),
(k.raw = k.raw.trimRight());
const m = k.items.length;
for (l = 0; l < m; l++) {
(this.lexer.state.top = !1),
(k.items[l].tokens = this.lexer.blockTokens(k.items[l].text, []));
const e = k.items[l].tokens.filter((e) => "space" === e.type),
t = e.every((e) => {
const t = e.raw.split("");
let n = 0;
for (const e of t) if (("\n" === e && (n += 1), n > 1)) return !0;
return !1;
});
!k.loose &&
e.length &&
t &&
((k.loose = !0), (k.items[l].loose = !0));
}
return k;
}
}
html(e) {
const t = this.rules.block.html.exec(e);
if (t) {
const e = {
type: "html",
raw: t[0],
pre:
!this.options.sanitizer &&
("pre" === t[1] || "script" === t[1] || "style" === t[1]),
text: t[0],
};
return (
this.options.sanitize &&
((e.type = "paragraph"),
(e.text = this.options.sanitizer
? this.options.sanitizer(t[0])
: o(t[0])),
(e.tokens = []),
this.lexer.inline(e.text, e.tokens)),
e
);
}
}
def(e) {
const t = this.rules.block.def.exec(e);
if (t) {
t[3] && (t[3] = t[3].substring(1, t[3].length - 1));
return {
type: "def",
tag: t[1].toLowerCase().replace(/\s+/g, " "),
raw: t[0],
href: t[2],
title: t[3],
};
}
}
table(e) {
const t = this.rules.block.table.exec(e);
if (t) {
const e = {
type: "table",
header: _(t[1]).map((e) => ({ text: e })),
align: t[2].replace(/^ *|\| *$/g, "").split(/ *\| */),
rows:
t[3] && t[3].trim()
? t[3].replace(/\n[ \t]*$/, "").split("\n")
: [],
};
if (e.header.length === e.align.length) {
e.raw = t[0];
let n,
r,
s,
i,
l = e.align.length;
for (n = 0; n < l; n++)
/^ *-+: *$/.test(e.align[n])
? (e.align[n] = "right")
: /^ *:-+: *$/.test(e.align[n])
? (e.align[n] = "center")
: /^ *:-+ *$/.test(e.align[n])
? (e.align[n] = "left")
: (e.align[n] = null);
for (l = e.rows.length, n = 0; n < l; n++)
e.rows[n] = _(e.rows[n], e.header.length).map((e) => ({ text: e }));
for (l = e.header.length, r = 0; r < l; r++)
(e.header[r].tokens = []),
this.lexer.inlineTokens(e.header[r].text, e.header[r].tokens);
for (l = e.rows.length, r = 0; r < l; r++)
for (i = e.rows[r], s = 0; s < i.length; s++)
(i[s].tokens = []),
this.lexer.inlineTokens(i[s].text, i[s].tokens);
return e;
}
}
}
lheading(e) {
const t = this.rules.block.lheading.exec(e);
if (t) {
const e = {
type: "heading",
raw: t[0],
depth: "=" === t[2].charAt(0) ? 1 : 2,
text: t[1],
tokens: [],
};
return this.lexer.inline(e.text, e.tokens), e;
}
}
paragraph(e) {
const t = this.rules.block.paragraph.exec(e);
if (t) {
const e = {
type: "paragraph",
raw: t[0],
text:
"\n" === t[1].charAt(t[1].length - 1) ? t[1].slice(0, -1) : t[1],
tokens: [],
};
return this.lexer.inline(e.text, e.tokens), e;
}
}
text(e) {
const t = this.rules.block.text.exec(e);
if (t) {
const e = { type: "text", raw: t[0], text: t[0], tokens: [] };
return this.lexer.inline(e.text, e.tokens), e;
}
}
escape(e) {
const t = this.rules.inline.escape.exec(e);
if (t) return { type: "escape", raw: t[0], text: o(t[1]) };
}
tag(e) {
const t = this.rules.inline.tag.exec(e);
if (t)
return (
!this.lexer.state.inLink && /^/i.test(t[0]) &&
(this.lexer.state.inLink = !1),
!this.lexer.state.inRawBlock &&
/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])
? (this.lexer.state.inRawBlock = !0)
: this.lexer.state.inRawBlock &&
/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0]) &&
(this.lexer.state.inRawBlock = !1),
{
type: this.options.sanitize ? "text" : "html",
raw: t[0],
inLink: this.lexer.state.inLink,
inRawBlock: this.lexer.state.inRawBlock,
text: this.options.sanitize
? this.options.sanitizer
? this.options.sanitizer(t[0])
: o(t[0])
: t[0],
}
);
}
link(e) {
const t = this.rules.inline.link.exec(e);
if (t) {
const e = t[2].trim();
if (!this.options.pedantic && /^$/.test(e)) return;
const t = z(e.slice(0, -1), "\\");
if ((e.length - t.length) % 2 == 0) return;
} else {
const e = (function (e, t) {
if (-1 === e.indexOf(t[1])) return -1;
const n = e.length;
let r = 0,
s = 0;
for (; s < n; s++)
if ("\\" === e[s]) s++;
else if (e[s] === t[0]) r++;
else if (e[s] === t[1] && (r--, r < 0)) return s;
return -1;
})(t[2], "()");
if (e > -1) {
const n = (0 === t[0].indexOf("!") ? 5 : 4) + t[1].length + e;
(t[2] = t[2].substring(0, e)),
(t[0] = t[0].substring(0, n).trim()),
(t[3] = "");
}
}
let n = t[2],
r = "";
if (this.options.pedantic) {
const e = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);
e && ((n = e[1]), (r = e[3]));
} else r = t[3] ? t[3].slice(1, -1) : "";
return (
(n = n.trim()),
/^$/.test(e)
? n.slice(1)
: n.slice(1, -1)),
T(
t,
{
href: n ? n.replace(this.rules.inline._escapes, "$1") : n,
title: r ? r.replace(this.rules.inline._escapes, "$1") : r,
},
t[0],
this.lexer
)
);
}
}
reflink(e, t) {
let n;
if (
(n = this.rules.inline.reflink.exec(e)) ||
(n = this.rules.inline.nolink.exec(e))
) {
let e = (n[2] || n[1]).replace(/\s+/g, " ");
if (((e = t[e.toLowerCase()]), !e || !e.href)) {
const e = n[0].charAt(0);
return { type: "text", raw: e, text: e };
}
return T(n, e, n[0], this.lexer);
}
}
emStrong(e, t, n = "") {
let r = this.rules.inline.emStrong.lDelim.exec(e);
if (!r) return;
if (r[3] && n.match(/[\p{L}\p{N}]/u)) return;
const s = r[1] || r[2] || "";
if (!s || (s && ("" === n || this.rules.inline.punctuation.exec(n)))) {
const n = r[0].length - 1;
let s,
i,
l = n,
a = 0;
const o =
"*" === r[0][0]
? this.rules.inline.emStrong.rDelimAst
: this.rules.inline.emStrong.rDelimUnd;
for (
o.lastIndex = 0, t = t.slice(-1 * e.length + n);
null != (r = o.exec(t));
) {
if (((s = r[1] || r[2] || r[3] || r[4] || r[5] || r[6]), !s))
continue;
if (((i = s.length), r[3] || r[4])) {
l += i;
continue;
}
if ((r[5] || r[6]) && n % 3 && !((n + i) % 3)) {
a += i;
continue;
}
if (((l -= i), l > 0)) continue;
if (((i = Math.min(i, i + l + a)), Math.min(n, i) % 2)) {
const t = e.slice(1, n + r.index + i);
return {
type: "em",
raw: e.slice(0, n + r.index + i + 1),
text: t,
tokens: this.lexer.inlineTokens(t, []),
};
}
const t = e.slice(2, n + r.index + i - 1);
return {
type: "strong",
raw: e.slice(0, n + r.index + i + 1),
text: t,
tokens: this.lexer.inlineTokens(t, []),
};
}
}
}
codespan(e) {
const t = this.rules.inline.code.exec(e);
if (t) {
let e = t[2].replace(/\n/g, " ");
const n = /[^ ]/.test(e),
r = /^ /.test(e) && / $/.test(e);
return (
n && r && (e = e.substring(1, e.length - 1)),
(e = o(e, !0)),
{ type: "codespan", raw: t[0], text: e }
);
}
}
br(e) {
const t = this.rules.inline.br.exec(e);
if (t) return { type: "br", raw: t[0] };
}
del(e) {
const t = this.rules.inline.del.exec(e);
if (t)
return {
type: "del",
raw: t[0],
text: t[2],
tokens: this.lexer.inlineTokens(t[2], []),
};
}
autolink(e, t) {
const n = this.rules.inline.autolink.exec(e);
if (n) {
let e, r;
return (
"@" === n[2]
? ((e = o(this.options.mangle ? t(n[1]) : n[1])),
(r = "mailto:" + e))
: ((e = o(n[1])), (r = e)),
{
type: "link",
raw: n[0],
text: e,
href: r,
tokens: [{ type: "text", raw: e, text: e }],
}
);
}
}
url(e, t) {
let n;
if ((n = this.rules.inline.url.exec(e))) {
let e, r;
if ("@" === n[2])
(e = o(this.options.mangle ? t(n[0]) : n[0])), (r = "mailto:" + e);
else {
let t;
do {
(t = n[0]), (n[0] = this.rules.inline._backpedal.exec(n[0])[0]);
} while (t !== n[0]);
(e = o(n[0])), (r = "www." === n[1] ? "http://" + e : e);
}
return {
type: "link",
raw: n[0],
text: e,
href: r,
tokens: [{ type: "text", raw: e, text: e }],
};
}
}
inlineText(e, t) {
const n = this.rules.inline.text.exec(e);
if (n) {
let e;
return (
(e = this.lexer.state.inRawBlock
? this.options.sanitize
? this.options.sanitizer
? this.options.sanitizer(n[0])
: o(n[0])
: n[0]
: o(this.options.smartypants ? t(n[0]) : n[0])),
{ type: "text", raw: n[0], text: e }
);
}
}
}
const R = {
newline: /^(?: *(?:\n|$))+/,
code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
fences:
/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,
heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
list: /^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,
html: "^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\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|$))",
def: /^ {0,3}\[(label)\]: *(?:\n *)?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
table: w,
lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,
_paragraph:
/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
text: /^[^\n]+/,
_label: /(?!\s*\])(?:\\.|[^\[\]\\])+/,
_title: /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,
};
(R.def = u(R.def)
.replace("label", R._label)
.replace("title", R._title)
.getRegex()),
(R.bullet = /(?:[*+-]|\d{1,9}[.)])/),
(R.listItemStart = u(/^( *)(bull) */)
.replace("bull", R.bullet)
.getRegex()),
(R.list = u(R.list)
.replace(/bull/g, R.bullet)
.replace(
"hr",
"\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))"
)
.replace("def", "\\n+(?=" + R.def.source + ")")
.getRegex()),
(R._tag =
"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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul"),
(R._comment = /|$)/),
(R.html = u(R.html, "i")
.replace("comment", R._comment)
.replace("tag", R._tag)
.replace(
"attribute",
/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/
)
.getRegex()),
(R.paragraph = u(R._paragraph)
.replace("hr", R.hr)
.replace("heading", " {0,3}#{1,6} ")
.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", R._tag)
.getRegex()),
(R.blockquote = u(R.blockquote)
.replace("paragraph", R.paragraph)
.getRegex()),
(R.normal = y({}, R)),
(R.gfm = y({}, R.normal, {
table:
"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",
})),
(R.gfm.table = u(R.gfm.table)
.replace("hr", R.hr)
.replace("heading", " {0,3}#{1,6} ")
.replace("blockquote", " {0,3}>")
.replace("code", " {4}[^\\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", R._tag)
.getRegex()),
(R.gfm.paragraph = u(R._paragraph)
.replace("hr", R.hr)
.replace("heading", " {0,3}#{1,6} ")
.replace("|lheading", "")
.replace("table", R.gfm.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", R._tag)
.getRegex()),
(R.pedantic = y({}, R.normal, {
html: u(
"^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)| " + e + "
\n"
: "' +
(n ? e : o(e, !0)) +
"
\n"
);
}
blockquote(e) {
return "" + (n ? e : o(e, !0)) + "
\n" + e + "
\n";
}
html(e) {
return e;
}
heading(e, t, n, r) {
return this.options.headerIds
? "
\n" : "
\n";
}
list(e, t, n) {
const r = t ? "ol" : "ul";
return (
"<" +
r +
(t && 1 !== n ? ' start="' + n + '"' : "") +
">\n" +
e +
"" +
r +
">\n"
);
}
listitem(e) {
return "
" + e + "
";
}
br() {
return this.options.xhtml ? "An error occurred:
" + o(e.message + "", !0) + "" ); throw e; } } (N.options = N.setOptions = function (e) { var n; return y(N.defaults, e), (n = N.defaults), (t = n), N; }), (N.getDefaults = e), (N.defaults = t), (N.use = function (...e) { const t = y({}, ...e), n = N.defaults.extensions || { renderers: {}, childTokens: {} }; let r; e.forEach((e) => { if ( (e.extensions && ((r = !0), e.extensions.forEach((e) => { if (!e.name) throw new Error("extension name required"); if (e.renderer) { const t = n.renderers ? n.renderers[e.name] : null; n.renderers[e.name] = t ? function (...n) { let r = e.renderer.apply(this, n); return !1 === r && (r = t.apply(this, n)), r; } : e.renderer; } if (e.tokenizer) { if (!e.level || ("block" !== e.level && "inline" !== e.level)) throw new Error( "extension level must be 'block' or 'inline'" ); n[e.level] ? n[e.level].unshift(e.tokenizer) : (n[e.level] = [e.tokenizer]), e.start && ("block" === e.level ? n.startBlock ? n.startBlock.push(e.start) : (n.startBlock = [e.start]) : "inline" === e.level && (n.startInline ? n.startInline.push(e.start) : (n.startInline = [e.start]))); } e.childTokens && (n.childTokens[e.name] = e.childTokens); })), e.renderer) ) { const n = N.defaults.renderer || new L(); for (const t in e.renderer) { const r = n[t]; n[t] = (...s) => { let i = e.renderer[t].apply(n, s); return !1 === i && (i = r.apply(n, s)), i; }; } t.renderer = n; } if (e.tokenizer) { const n = N.defaults.tokenizer || new A(); for (const t in e.tokenizer) { const r = n[t]; n[t] = (...s) => { let i = e.tokenizer[t].apply(n, s); return !1 === i && (i = r.apply(n, s)), i; }; } t.tokenizer = n; } if (e.walkTokens) { const n = N.defaults.walkTokens; t.walkTokens = function (t) { e.walkTokens.call(this, t), n && n.call(this, t); }; } r && (t.extensions = n), N.setOptions(t); }); }), (N.walkTokens = function (e, t) { for (const n of e) switch ((t.call(N, n), n.type)) { case "table": for (const e of n.header) N.walkTokens(e.tokens, t); for (const e of n.rows) for (const n of e) N.walkTokens(n.tokens, t); break; case "list": N.walkTokens(n.items, t); break; default: N.defaults.extensions && N.defaults.extensions.childTokens && N.defaults.extensions.childTokens[n.type] ? N.defaults.extensions.childTokens[n.type].forEach(function (e) { N.walkTokens(n[e], t); }) : n.tokens && N.walkTokens(n.tokens, t); } }), (N.parseInline = function (e, t) { if (null == e) throw new Error( "marked.parseInline(): input parameter is undefined or null" ); if ("string" != typeof e) throw new Error( "marked.parseInline(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected" ); S((t = y({}, N.defaults, t || {}))); try { const n = q.lexInline(e, t); return ( t.walkTokens && N.walkTokens(n, t.walkTokens), O.parseInline(n, t) ); } catch (e) { if ( ((e.message += "\nPlease report this to https://github.com/markedjs/marked."), t.silent) ) return ( "
An error occurred:
" + o(e.message + "", !0) + "" ); throw e; } }), (N.Parser = O), (N.parser = O.parse), (N.Renderer = L), (N.TextRenderer = Z), (N.Lexer = q), (N.lexer = q.lex), (N.Tokenizer = A), (N.Slugger = C), (N.parse = N); /*! * The reveal.js markdown plugin. Handles parsing of * markdown inside of presentations as well as loading * of external markdown documents. */ const D = "__SCRIPT_END__", M = /\[([\s\d,|-]*)\]/, P = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }; return () => { let e; function t(e) { var t = ( e.querySelector("[data-template]") || e.querySelector("script") || e ).textContent, n = (t = t.replace(new RegExp(D, "g"), "")).match( /^\n?(\s*)/ )[1].length, r = t.match(/^\n?(\t*)/)[1].length; return ( r > 0 ? (t = t.replace( new RegExp("\\n?\\t{" + r + "}(.*)", "g"), function (e, t) { return "\n" + t; } )) : n > 1 && (t = t.replace( new RegExp("\\n? {" + n + "}(.*)", "g"), function (e, t) { return "\n" + t; } )), t ); } function n(e) { for (var t = e.attributes, n = [], r = 0, s = t.length; r < s; r++) { var i = t[r].name, l = t[r].value; /data\-(markdown|separator|vertical|notes)/gi.test(i) || (l ? n.push(i + '="' + l + '"') : n.push(i)); } return n.join(" "); } function r(e) { return ( ((e = e || {}).separator = e.separator || "\r?\n---\r?\n"), (e.notesSeparator = e.notesSeparator || "notes?:"), (e.attributes = e.attributes || ""), e ); } function s(e, t) { t = r(t); var n = e.split(new RegExp(t.notesSeparator, "mgi")); return ( 2 === n.length && (e = n[0] + '"), '" ); } function i(e, t) { t = r(t); for ( var n, i, l, a = new RegExp( t.separator + (t.verticalSeparator ? "|" + t.verticalSeparator : ""), "mg" ), o = new RegExp(t.separator), c = 0, h = !0, p = []; (n = a.exec(e)); ) !(i = o.test(n[0])) && h && p.push([]), (l = e.substring(c, n.index)), i && h ? p.push(l) : p[p.length - 1].push(l), (c = a.lastIndex), (h = i); (h ? p : p[p.length - 1]).push(e.substring(c)); for (var u = "", g = 0, d = p.length; g < d; g++) p[g] instanceof Array ? ((u += "
Remember that you need to serve the presentation HTML from a HTTP server.
${(e = e.replace(
/([&<>'"])/g,
(e) => P[e]
))}
`
);
})),
!0 === r && (n.listitem = (e) => `