vue-files-preview-inno
Version:
A tool for previewing files such as doc, excel, pdf, image, markdown, txt, audio, and video and so on.
252 lines (251 loc) • 6.47 kB
JavaScript
var A, m;
function Z() {
if (m) return A;
m = 1;
function b(r) {
const p = r.regex.either(...[
"(?:NeedsTeXFormat|RequirePackage|GetIdInfo)",
"Provides(?:Expl)?(?:Package|Class|File)",
"(?:DeclareOption|ProcessOptions)",
"(?:documentclass|usepackage|input|include)",
"makeat(?:letter|other)",
"ExplSyntax(?:On|Off)",
"(?:new|renew|provide)?command",
"(?:re)newenvironment",
"(?:New|Renew|Provide|Declare)(?:Expandable)?DocumentCommand",
"(?:New|Renew|Provide|Declare)DocumentEnvironment",
"(?:(?:e|g|x)?def|let)",
"(?:begin|end)",
"(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph)",
"caption",
"(?:label|(?:eq|page|name)?ref|(?:paren|foot|super)?cite)",
"(?:alpha|beta|[Gg]amma|[Dd]elta|(?:var)?epsilon|zeta|eta|[Tt]heta|vartheta)",
"(?:iota|(?:var)?kappa|[Ll]ambda|mu|nu|[Xx]i|[Pp]i|varpi|(?:var)rho)",
"(?:[Ss]igma|varsigma|tau|[Uu]psilon|[Pp]hi|varphi|chi|[Pp]si|[Oo]mega)",
"(?:frac|sum|prod|lim|infty|times|sqrt|leq|geq|left|right|middle|[bB]igg?)",
"(?:[lr]angle|q?quad|[lcvdi]?dots|d?dot|hat|tilde|bar)"
].map((e) => e + "(?![a-zA-Z@:_])")), v = new RegExp([
// A function \module_function_name:signature or \__module_function_name:signature,
// where both module and function_name need at least two characters and
// function_name may contain single underscores.
"(?:__)?[a-zA-Z]{2,}_[a-zA-Z](?:_?[a-zA-Z])+:[a-zA-Z]*",
// A variable \scope_module_and_name_type or \scope__module_ane_name_type,
// where scope is one of l, g or c, type needs at least two characters
// and module_and_name may contain single underscores.
"[lgc]__?[a-zA-Z](?:_?[a-zA-Z])*_[a-zA-Z]{2,}",
// A quark \q_the_name or \q__the_name or
// scan mark \s_the_name or \s__vthe_name,
// where variable_name needs at least two characters and
// may contain single underscores.
"[qs]__?[a-zA-Z](?:_?[a-zA-Z])+",
// Other LaTeX3 macro names that are not covered by the three rules above.
"use(?:_i)?:[a-zA-Z]*",
"(?:else|fi|or):",
"(?:if|cs|exp):w",
"(?:hbox|vbox):n",
"::[a-zA-Z]_unbraced",
"::[a-zA-Z:]"
].map((e) => e + "(?![a-zA-Z:_])").join("|")), N = [
{ begin: /[a-zA-Z@]+/ },
// control word
{ begin: /[^a-zA-Z@]?/ }
// control symbol
], g = [
{ begin: /\^{6}[0-9a-f]{6}/ },
{ begin: /\^{5}[0-9a-f]{5}/ },
{ begin: /\^{4}[0-9a-f]{4}/ },
{ begin: /\^{3}[0-9a-f]{3}/ },
{ begin: /\^{2}[0-9a-f]{2}/ },
{ begin: /\^{2}[\u0000-\u007f]/ }
], R = {
className: "keyword",
begin: /\\/,
relevance: 0,
contains: [
{
endsParent: !0,
begin: p
},
{
endsParent: !0,
begin: v
},
{
endsParent: !0,
variants: g
},
{
endsParent: !0,
relevance: 0,
variants: N
}
]
}, T = {
className: "params",
relevance: 0,
begin: /#+\d?/
}, M = {
// relevance: 1
variants: g
}, B = {
className: "built_in",
relevance: 0,
begin: /[$&^_]/
}, C = {
className: "meta",
begin: /% ?!(T[eE]X|tex|BIB|bib)/,
end: "$",
relevance: 10
}, I = r.COMMENT(
"%",
"$",
{ relevance: 0 }
), c = [
R,
T,
M,
B,
C,
I
], E = {
begin: /\{/,
end: /\}/,
relevance: 0,
contains: [
"self",
...c
]
}, O = r.inherit(
E,
{
relevance: 0,
endsParent: !0,
contains: [
E,
...c
]
}
), P = {
begin: /\[/,
end: /\]/,
endsParent: !0,
relevance: 0,
contains: [
E,
...c
]
}, u = {
begin: /\s+/,
relevance: 0
}, i = [O], _ = [P], n = function(e, a) {
return {
contains: [u],
starts: {
relevance: 0,
contains: e,
starts: a
}
};
}, t = function(e, a) {
return {
begin: "\\\\" + e + "(?![a-zA-Z@:_])",
keywords: {
$pattern: /\\[a-zA-Z]+/,
keyword: "\\" + e
},
relevance: 0,
contains: [u],
starts: a
};
}, o = function(e, a) {
return r.inherit(
{
begin: "\\\\begin(?=[ ]*(\\r?\\n[ ]*)?\\{" + e + "\\})",
keywords: {
$pattern: /\\[a-zA-Z]+/,
keyword: "\\begin"
},
relevance: 0
},
n(i, a)
);
}, d = (e = "string") => r.END_SAME_AS_BEGIN({
className: e,
begin: /(.|\r?\n)/,
end: /(.|\r?\n)/,
excludeBegin: !0,
excludeEnd: !0,
endsParent: !0
}), l = function(e) {
return {
className: "string",
end: "(?=\\\\end\\{" + e + "\\})"
};
}, s = (e = "string") => ({
relevance: 0,
begin: /\{/,
starts: {
endsParent: !0,
contains: [
{
className: e,
end: /(?=\})/,
endsParent: !0,
contains: [
{
begin: /\{/,
end: /\}/,
relevance: 0,
contains: ["self"]
}
]
}
]
}
}), z = [
...[
"verb",
"lstinline"
].map((e) => t(e, { contains: [d()] })),
t("mint", n(i, { contains: [d()] })),
t("mintinline", n(i, { contains: [
s(),
d()
] })),
t("url", { contains: [
s("link"),
s("link")
] }),
t("hyperref", { contains: [s("link")] }),
t("href", n(_, { contains: [s("link")] })),
...[].concat(...[
"",
"\\*"
].map((e) => [
o("verbatim" + e, l("verbatim" + e)),
o("filecontents" + e, n(i, l("filecontents" + e))),
...[
"",
"B",
"L"
].map(
(a) => o(a + "Verbatim" + e, n(_, l(a + "Verbatim" + e)))
)
])),
o("minted", n(_, n(i, l("minted"))))
];
return {
name: "LaTeX",
aliases: ["tex"],
contains: [
...z,
...c
]
};
}
return A = b, A;
}
export {
Z as __require
};
//# sourceMappingURL=latex.mjs.map