зеркало из https://github.com/nextcloud/text.git
1 строка
12 KiB
Plaintext
1 строка
12 KiB
Plaintext
{"version":3,"file":"latex-BidkzKI9.chunk.mjs","sources":["../node_modules/highlight.js/lib/languages/latex.js"],"sourcesContent":["/*\nLanguage: LaTeX\nAuthor: Benedikt Wilde <bwilde@posteo.de>\nWebsite: https://www.latex-project.org\nCategory: markup\n*/\n\n/** @type LanguageFn */\nfunction latex(hljs) {\n const regex = hljs.regex;\n const KNOWN_CONTROL_WORDS = regex.either(...[\n '(?:NeedsTeXFormat|RequirePackage|GetIdInfo)',\n 'Provides(?:Expl)?(?:Package|Class|File)',\n '(?:DeclareOption|ProcessOptions)',\n '(?:documentclass|usepackage|input|include)',\n 'makeat(?:letter|other)',\n 'ExplSyntax(?:On|Off)',\n '(?:new|renew|provide)?command',\n '(?:re)newenvironment',\n '(?:New|Renew|Provide|Declare)(?:Expandable)?DocumentCommand',\n '(?:New|Renew|Provide|Declare)DocumentEnvironment',\n '(?:(?:e|g|x)?def|let)',\n '(?:begin|end)',\n '(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph)',\n 'caption',\n '(?:label|(?:eq|page|name)?ref|(?:paren|foot|super)?cite)',\n '(?:alpha|beta|[Gg]amma|[Dd]elta|(?:var)?epsilon|zeta|eta|[Tt]heta|vartheta)',\n '(?:iota|(?:var)?kappa|[Ll]ambda|mu|nu|[Xx]i|[Pp]i|varpi|(?:var)rho)',\n '(?:[Ss]igma|varsigma|tau|[Uu]psilon|[Pp]hi|varphi|chi|[Pp]si|[Oo]mega)',\n '(?:frac|sum|prod|lim|infty|times|sqrt|leq|geq|left|right|middle|[bB]igg?)',\n '(?:[lr]angle|q?quad|[lcvdi]?dots|d?dot|hat|tilde|bar)'\n ].map(word => word + '(?![a-zA-Z@:_])'));\n const L3_REGEX = new RegExp([\n // A function \\module_function_name:signature or \\__module_function_name:signature,\n // where both module and function_name need at least two characters and\n // function_name may contain single underscores.\n '(?:__)?[a-zA-Z]{2,}_[a-zA-Z](?:_?[a-zA-Z])+:[a-zA-Z]*',\n // A variable \\scope_module_and_name_type or \\scope__module_ane_name_type,\n // where scope is one of l, g or c, type needs at least two characters\n // and module_and_name may contain single underscores.\n '[lgc]__?[a-zA-Z](?:_?[a-zA-Z])*_[a-zA-Z]{2,}',\n // A quark \\q_the_name or \\q__the_name or\n // scan mark \\s_the_name or \\s__vthe_name,\n // where variable_name needs at least two characters and\n // may contain single underscores.\n '[qs]__?[a-zA-Z](?:_?[a-zA-Z])+',\n // Other LaTeX3 macro names that are not covered by the three rules above.\n 'use(?:_i)?:[a-zA-Z]*',\n '(?:else|fi|or):',\n '(?:if|cs|exp):w',\n '(?:hbox|vbox):n',\n '::[a-zA-Z]_unbraced',\n '::[a-zA-Z:]'\n ].map(pattern => pattern + '(?![a-zA-Z:_])').join('|'));\n const L2_VARIANTS = [\n { begin: /[a-zA-Z@]+/ }, // control word\n { begin: /[^a-zA-Z@]?/ } // control symbol\n ];\n const DOUBLE_CARET_VARIANTS = [\n { begin: /\\^{6}[0-9a-f]{6}/ },\n { begin: /\\^{5}[0-9a-f]{5}/ },\n { begin: /\\^{4}[0-9a-f]{4}/ },\n { begin: /\\^{3}[0-9a-f]{3}/ },\n { begin: /\\^{2}[0-9a-f]{2}/ },\n { begin: /\\^{2}[\\u0000-\\u007f]/ }\n ];\n const CONTROL_SEQUENCE = {\n className: 'keyword',\n begin: /\\\\/,\n relevance: 0,\n contains: [\n {\n endsParent: true,\n begin: KNOWN_CONTROL_WORDS\n },\n {\n endsParent: true,\n begin: L3_REGEX\n },\n {\n endsParent: true,\n variants: DOUBLE_CARET_VARIANTS\n },\n {\n endsParent: true,\n relevance: 0,\n variants: L2_VARIANTS\n }\n ]\n };\n const MACRO_PARAM = {\n className: 'params',\n relevance: 0,\n begin: /#+\\d?/\n };\n const DOUBLE_CARET_CHAR = {\n // relevance: 1\n variants: DOUBLE_CARET_VARIANTS };\n const SPECIAL_CATCODE = {\n className: 'built_in',\n relevance: 0,\n begin: /[$&^_]/\n };\n const MAGIC_COMMENT = {\n className: 'meta',\n begin: /% ?!(T[eE]X|tex|BIB|bib)/,\n end: '$',\n relevance: 10\n };\n const COMMENT = hljs.COMMENT(\n '%',\n '$',\n { relevance: 0 }\n );\n const EVERYTHING_BUT_VERBATIM = [\n CONTROL_SEQUENCE,\n MACRO_PARAM,\n DOUBLE_CARET_CHAR,\n SPECIAL_CATCODE,\n MAGIC_COMMENT,\n COMMENT\n ];\n const BRACE_GROUP_NO_VERBATIM = {\n begin: /\\{/,\n end: /\\}/,\n relevance: 0,\n contains: [\n 'self',\n ...EVERYTHING_BUT_VERBATIM\n ]\n };\n const ARGUMENT_BRACES = hljs.inherit(\n BRACE_GROUP_NO_VERBATIM,\n {\n relevance: 0,\n endsParent: true,\n contains: [\n BRACE_GROUP_NO_VERBATIM,\n ...EVERYTHING_BUT_VERBATIM\n ]\n }\n );\n const ARGUMENT_BRACKETS = {\n begin: /\\[/,\n end: /\\]/,\n endsParent: true,\n relevance: 0,\n contains: [\n BRACE_GROUP_NO_VERBATIM,\n ...EVERYTHING_BUT_VERBATIM\n ]\n };\n const SPACE_GOBBLER = {\n begin: /\\s+/,\n relevance: 0\n };\n const ARGUMENT_M = [ ARGUMENT_BRACES ];\n const ARGUMENT_O = [ ARGUMENT_BRACKETS ];\n const ARGUMENT_AND_THEN = function(arg, starts_mode) {\n return {\n contains: [ SPACE_GOBBLER ],\n starts: {\n relevance: 0,\n contains: arg,\n starts: starts_mode\n }\n };\n };\n const CSNAME = function(csname, starts_mode) {\n return {\n begin: '\\\\\\\\' + csname + '(?![a-zA-Z@:_])',\n keywords: {\n $pattern: /\\\\[a-zA-Z]+/,\n keyword: '\\\\' + csname\n },\n relevance: 0,\n contains: [ SPACE_GOBBLER ],\n starts: starts_mode\n };\n };\n const BEGIN_ENV = function(envname, starts_mode) {\n return hljs.inherit(\n {\n begin: '\\\\\\\\begin(?=[ \\t]*(\\\\r?\\\\n[ \\t]*)?\\\\{' + envname + '\\\\})',\n keywords: {\n $pattern: /\\\\[a-zA-Z]+/,\n keyword: '\\\\begin'\n },\n relevance: 0,\n },\n ARGUMENT_AND_THEN(ARGUMENT_M, starts_mode)\n );\n };\n const VERBATIM_DELIMITED_EQUAL = (innerName = \"string\") => {\n return hljs.END_SAME_AS_BEGIN({\n className: innerName,\n begin: /(.|\\r?\\n)/,\n end: /(.|\\r?\\n)/,\n excludeBegin: true,\n excludeEnd: true,\n endsParent: true\n });\n };\n const VERBATIM_DELIMITED_ENV = function(envname) {\n return {\n className: 'string',\n end: '(?=\\\\\\\\end\\\\{' + envname + '\\\\})'\n };\n };\n\n const VERBATIM_DELIMITED_BRACES = (innerName = \"string\") => {\n return {\n relevance: 0,\n begin: /\\{/,\n starts: {\n endsParent: true,\n contains: [\n {\n className: innerName,\n end: /(?=\\})/,\n endsParent: true,\n contains: [\n {\n begin: /\\{/,\n end: /\\}/,\n relevance: 0,\n contains: [ \"self\" ]\n }\n ],\n }\n ]\n }\n };\n };\n const VERBATIM = [\n ...[\n 'verb',\n 'lstinline'\n ].map(csname => CSNAME(csname, { contains: [ VERBATIM_DELIMITED_EQUAL() ] })),\n CSNAME('mint', ARGUMENT_AND_THEN(ARGUMENT_M, { contains: [ VERBATIM_DELIMITED_EQUAL() ] })),\n CSNAME('mintinline', ARGUMENT_AND_THEN(ARGUMENT_M, { contains: [\n VERBATIM_DELIMITED_BRACES(),\n VERBATIM_DELIMITED_EQUAL()\n ] })),\n CSNAME('url', { contains: [\n VERBATIM_DELIMITED_BRACES(\"link\"),\n VERBATIM_DELIMITED_BRACES(\"link\")\n ] }),\n CSNAME('hyperref', { contains: [ VERBATIM_DELIMITED_BRACES(\"link\") ] }),\n CSNAME('href', ARGUMENT_AND_THEN(ARGUMENT_O, { contains: [ VERBATIM_DELIMITED_BRACES(\"link\") ] })),\n ...[].concat(...[\n '',\n '\\\\*'\n ].map(suffix => [\n BEGIN_ENV('verbatim' + suffix, VERBATIM_DELIMITED_ENV('verbatim' + suffix)),\n BEGIN_ENV('filecontents' + suffix, ARGUMENT_AND_THEN(ARGUMENT_M, VERBATIM_DELIMITED_ENV('filecontents' + suffix))),\n ...[\n '',\n 'B',\n 'L'\n ].map(prefix =>\n BEGIN_ENV(prefix + 'Verbatim' + suffix, ARGUMENT_AND_THEN(ARGUMENT_O, VERBATIM_DELIMITED_ENV(prefix + 'Verbatim' + suffix)))\n )\n ])),\n BEGIN_ENV('minted', ARGUMENT_AND_THEN(ARGUMENT_O, ARGUMENT_AND_THEN(ARGUMENT_M, VERBATIM_DELIMITED_ENV('minted')))),\n ];\n\n return {\n name: 'LaTeX',\n aliases: [ 'tex' ],\n contains: [\n ...VERBATIM,\n ...EVERYTHING_BUT_VERBATIM\n ]\n };\n}\n\nmodule.exports = latex;\n"],"names":["latex","hljs","KNOWN_CONTROL_WORDS","word","L3_REGEX","pattern","L2_VARIANTS","DOUBLE_CARET_VARIANTS","CONTROL_SEQUENCE","MACRO_PARAM","DOUBLE_CARET_CHAR","SPECIAL_CATCODE","MAGIC_COMMENT","COMMENT","EVERYTHING_BUT_VERBATIM","BRACE_GROUP_NO_VERBATIM","ARGUMENT_BRACES","ARGUMENT_BRACKETS","SPACE_GOBBLER","ARGUMENT_M","ARGUMENT_O","ARGUMENT_AND_THEN","arg","starts_mode","CSNAME","csname","BEGIN_ENV","envname","VERBATIM_DELIMITED_EQUAL","innerName","VERBATIM_DELIMITED_ENV","VERBATIM_DELIMITED_BRACES","VERBATIM","suffix","prefix","latex_1"],"mappings":";4YAQA,SAASA,EAAMC,EAAM,CAEnB,MAAMC,EADQD,EAAK,MACe,OAAO,GAAG,CAC1C,8CACA,0CACA,mCACA,6CACA,yBACA,uBACA,gCACA,uBACA,8DACA,mDACA,wBACA,gBACA,yDACA,UACA,2DACA,8EACA,sEACA,yEACA,4EACA,uDACD,EAAC,IAAIE,GAAQA,EAAO,iBAAiB,CAAC,EACjCC,EAAW,IAAI,OAAO,CAI1B,wDAIA,+CAKA,iCAEA,uBACA,kBACA,kBACA,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