315 lines
11 KiB
JavaScript
315 lines
11 KiB
JavaScript
/*
|
|
* Extracted from browser-delivered Turbopack chunk: 939e07c76f4b30f0.294c1bf0d6.js
|
|
* Module id: 71104
|
|
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
|
*/
|
|
|
|
const moduleFactory = (e, t, i) => {
|
|
"use strict";
|
|
function r(e) {
|
|
!(function (e) {
|
|
var t = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;
|
|
function i(e) {
|
|
return (
|
|
(e = e.replace(/<inner>/g, function () {
|
|
return t;
|
|
})),
|
|
RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + "(?:" + e + ")")
|
|
);
|
|
}
|
|
var r = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/
|
|
.source,
|
|
a = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(
|
|
/__/g,
|
|
function () {
|
|
return r;
|
|
},
|
|
),
|
|
n =
|
|
/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/
|
|
.source;
|
|
(e.languages.markdown = e.languages.extend("markup", {})),
|
|
e.languages.insertBefore("markdown", "prolog", {
|
|
"front-matter-block": {
|
|
pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,
|
|
lookbehind: !0,
|
|
greedy: !0,
|
|
inside: {
|
|
punctuation: /^---|---$/,
|
|
"front-matter": {
|
|
pattern: /\S+(?:\s+\S+)*/,
|
|
alias: ["yaml", "language-yaml"],
|
|
inside: e.languages.yaml,
|
|
},
|
|
},
|
|
},
|
|
blockquote: { pattern: /^>(?:[\t ]*>)*/m, alias: "punctuation" },
|
|
table: {
|
|
pattern: RegExp("^" + a + n + "(?:" + a + ")*", "m"),
|
|
inside: {
|
|
"table-data-rows": {
|
|
pattern: RegExp("^(" + a + n + ")(?:" + a + ")*$"),
|
|
lookbehind: !0,
|
|
inside: {
|
|
"table-data": {
|
|
pattern: RegExp(r),
|
|
inside: e.languages.markdown,
|
|
},
|
|
punctuation: /\|/,
|
|
},
|
|
},
|
|
"table-line": {
|
|
pattern: RegExp("^(" + a + ")" + n + "$"),
|
|
lookbehind: !0,
|
|
inside: { punctuation: /\||:?-{3,}:?/ },
|
|
},
|
|
"table-header-row": {
|
|
pattern: RegExp("^" + a + "$"),
|
|
inside: {
|
|
"table-header": {
|
|
pattern: RegExp(r),
|
|
alias: "important",
|
|
inside: e.languages.markdown,
|
|
},
|
|
punctuation: /\|/,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
code: [
|
|
{
|
|
pattern:
|
|
/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,
|
|
lookbehind: !0,
|
|
alias: "keyword",
|
|
},
|
|
{
|
|
pattern: /^```[\s\S]*?^```$/m,
|
|
greedy: !0,
|
|
inside: {
|
|
"code-block": {
|
|
pattern:
|
|
/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,
|
|
lookbehind: !0,
|
|
},
|
|
"code-language": { pattern: /^(```).+/, lookbehind: !0 },
|
|
punctuation: /```/,
|
|
},
|
|
},
|
|
],
|
|
title: [
|
|
{
|
|
pattern: /\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,
|
|
alias: "important",
|
|
inside: { punctuation: /==+$|--+$/ },
|
|
},
|
|
{
|
|
pattern: /(^\s*)#.+/m,
|
|
lookbehind: !0,
|
|
alias: "important",
|
|
inside: { punctuation: /^#+|#+$/ },
|
|
},
|
|
],
|
|
hr: {
|
|
pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,
|
|
lookbehind: !0,
|
|
alias: "punctuation",
|
|
},
|
|
list: {
|
|
pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,
|
|
lookbehind: !0,
|
|
alias: "punctuation",
|
|
},
|
|
"url-reference": {
|
|
pattern:
|
|
/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,
|
|
inside: {
|
|
variable: { pattern: /^(!?\[)[^\]]+/, lookbehind: !0 },
|
|
string:
|
|
/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,
|
|
punctuation: /^[\[\]!:]|[<>]/,
|
|
},
|
|
alias: "url",
|
|
},
|
|
bold: {
|
|
pattern: i(
|
|
/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/
|
|
.source,
|
|
),
|
|
lookbehind: !0,
|
|
greedy: !0,
|
|
inside: {
|
|
content: {
|
|
pattern: /(^..)[\s\S]+(?=..$)/,
|
|
lookbehind: !0,
|
|
inside: {},
|
|
},
|
|
punctuation: /\*\*|__/,
|
|
},
|
|
},
|
|
italic: {
|
|
pattern: i(
|
|
/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/
|
|
.source,
|
|
),
|
|
lookbehind: !0,
|
|
greedy: !0,
|
|
inside: {
|
|
content: {
|
|
pattern: /(^.)[\s\S]+(?=.$)/,
|
|
lookbehind: !0,
|
|
inside: {},
|
|
},
|
|
punctuation: /[*_]/,
|
|
},
|
|
},
|
|
strike: {
|
|
pattern: i(/(~~?)(?:(?!~)<inner>)+\2/.source),
|
|
lookbehind: !0,
|
|
greedy: !0,
|
|
inside: {
|
|
content: {
|
|
pattern: /(^~~?)[\s\S]+(?=\1$)/,
|
|
lookbehind: !0,
|
|
inside: {},
|
|
},
|
|
punctuation: /~~?/,
|
|
},
|
|
},
|
|
"code-snippet": {
|
|
pattern:
|
|
/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,
|
|
lookbehind: !0,
|
|
greedy: !0,
|
|
alias: ["code", "keyword"],
|
|
},
|
|
url: {
|
|
pattern: i(
|
|
/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/
|
|
.source,
|
|
),
|
|
lookbehind: !0,
|
|
greedy: !0,
|
|
inside: {
|
|
operator: /^!/,
|
|
content: {
|
|
pattern: /(^\[)[^\]]+(?=\])/,
|
|
lookbehind: !0,
|
|
inside: {},
|
|
},
|
|
variable: {
|
|
pattern: /(^\][ \t]?\[)[^\]]+(?=\]$)/,
|
|
lookbehind: !0,
|
|
},
|
|
url: { pattern: /(^\]\()[^\s)]+/, lookbehind: !0 },
|
|
string: {
|
|
pattern: /(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,
|
|
lookbehind: !0,
|
|
},
|
|
},
|
|
},
|
|
}),
|
|
["url", "bold", "italic", "strike"].forEach(function (t) {
|
|
["url", "bold", "italic", "strike", "code-snippet"].forEach(
|
|
function (i) {
|
|
t !== i &&
|
|
(e.languages.markdown[t].inside.content.inside[i] =
|
|
e.languages.markdown[i]);
|
|
},
|
|
);
|
|
}),
|
|
e.hooks.add("after-tokenize", function (e) {
|
|
("markdown" === e.language || "md" === e.language) &&
|
|
(function e(t) {
|
|
if (t && "string" != typeof t)
|
|
for (var i = 0, r = t.length; i < r; i++) {
|
|
var a = t[i];
|
|
if ("code" !== a.type) {
|
|
e(a.content);
|
|
continue;
|
|
}
|
|
var n = a.content[1],
|
|
A = a.content[3];
|
|
if (
|
|
n &&
|
|
A &&
|
|
"code-language" === n.type &&
|
|
"code-block" === A.type &&
|
|
"string" == typeof n.content
|
|
) {
|
|
var s = n.content
|
|
.replace(/\b#/g, "sharp")
|
|
.replace(/\b\+\+/g, "pp"),
|
|
o =
|
|
"language-" +
|
|
(s = (/[a-z][\w-]*/i.exec(s) || [
|
|
"",
|
|
])[0].toLowerCase());
|
|
A.alias
|
|
? "string" == typeof A.alias
|
|
? (A.alias = [A.alias, o])
|
|
: A.alias.push(o)
|
|
: (A.alias = [o]);
|
|
}
|
|
}
|
|
})(e.tokens);
|
|
}),
|
|
e.hooks.add("wrap", function (t) {
|
|
if ("code-block" === t.type) {
|
|
for (var i, r = "", a = 0, n = t.classes.length; a < n; a++) {
|
|
var l = t.classes[a],
|
|
c = /language-(.+)/.exec(l);
|
|
if (c) {
|
|
r = c[1];
|
|
break;
|
|
}
|
|
}
|
|
var d = e.languages[r];
|
|
if (d) {
|
|
t.content = e.highlight(
|
|
(i = t.content.value.replace(A, "")).replace(
|
|
/&(\w{1,8}|#x?[\da-f]{1,8});/gi,
|
|
function (e, t) {
|
|
if ("#" === (t = t.toLowerCase())[0])
|
|
return o(
|
|
"x" === t[1]
|
|
? parseInt(t.slice(2), 16)
|
|
: Number(t.slice(1)),
|
|
);
|
|
var i = s[t];
|
|
return i || e;
|
|
},
|
|
),
|
|
d,
|
|
r,
|
|
);
|
|
} else if (r && "none" !== r && e.plugins.autoloader) {
|
|
var u =
|
|
"md-" +
|
|
new Date().valueOf() +
|
|
"-" +
|
|
Math.floor(1e16 * Math.random());
|
|
(t.attributes.id = u),
|
|
e.plugins.autoloader.loadLanguages(r, function () {
|
|
var t = document.getElementById(u);
|
|
t &&
|
|
(t.innerHTML = e.highlight(
|
|
t.textContent,
|
|
e.languages[r],
|
|
r,
|
|
));
|
|
});
|
|
}
|
|
}
|
|
});
|
|
var A = RegExp(e.languages.markup.tag.pattern.source, "gi"),
|
|
s = { amp: "&", lt: "<", gt: ">", quot: '"' },
|
|
o = String.fromCodePoint || String.fromCharCode;
|
|
e.languages.md = e.languages.markdown;
|
|
})(e);
|
|
}
|
|
(t.exports = r), (r.displayName = "markdown"), (r.aliases = ["md"]);
|
|
};
|
|
|
|
export default moduleFactory;
|