зеркало из https://github.com/nextcloud/text.git
1 строка
9.5 KiB
Plaintext
1 строка
9.5 KiB
Plaintext
{"version":3,"file":"handlebars-Cym-9yHt.chunk.mjs","sources":["../node_modules/highlight.js/lib/languages/handlebars.js"],"sourcesContent":["/*\nLanguage: Handlebars\nRequires: xml.js\nAuthor: Robin Ward <robin.ward@gmail.com>\nDescription: Matcher for Handlebars as well as EmberJS additions.\nWebsite: https://handlebarsjs.com\nCategory: template\n*/\n\nfunction handlebars(hljs) {\n const regex = hljs.regex;\n const BUILT_INS = {\n $pattern: /[\\w.\\/]+/,\n built_in: [\n 'action',\n 'bindattr',\n 'collection',\n 'component',\n 'concat',\n 'debugger',\n 'each',\n 'each-in',\n 'get',\n 'hash',\n 'if',\n 'in',\n 'input',\n 'link-to',\n 'loc',\n 'log',\n 'lookup',\n 'mut',\n 'outlet',\n 'partial',\n 'query-params',\n 'render',\n 'template',\n 'textarea',\n 'unbound',\n 'unless',\n 'view',\n 'with',\n 'yield'\n ]\n };\n\n const LITERALS = {\n $pattern: /[\\w.\\/]+/,\n literal: [\n 'true',\n 'false',\n 'undefined',\n 'null'\n ]\n };\n\n // as defined in https://handlebarsjs.com/guide/expressions.html#literal-segments\n // this regex matches literal segments like ' abc ' or [ abc ] as well as helpers and paths\n // like a/b, ./abc/cde, and abc.bcd\n\n const DOUBLE_QUOTED_ID_REGEX = /\"\"|\"[^\"]+\"/;\n const SINGLE_QUOTED_ID_REGEX = /''|'[^']+'/;\n const BRACKET_QUOTED_ID_REGEX = /\\[\\]|\\[[^\\]]+\\]/;\n const PLAIN_ID_REGEX = /[^\\s!\"#%&'()*+,.\\/;<=>@\\[\\\\\\]^`{|}~]+/;\n const PATH_DELIMITER_REGEX = /(\\.|\\/)/;\n const ANY_ID = regex.either(\n DOUBLE_QUOTED_ID_REGEX,\n SINGLE_QUOTED_ID_REGEX,\n BRACKET_QUOTED_ID_REGEX,\n PLAIN_ID_REGEX\n );\n\n const IDENTIFIER_REGEX = regex.concat(\n regex.optional(/\\.|\\.\\/|\\//), // relative or absolute path\n ANY_ID,\n regex.anyNumberOfTimes(regex.concat(\n PATH_DELIMITER_REGEX,\n ANY_ID\n ))\n );\n\n // identifier followed by a equal-sign (without the equal sign)\n const HASH_PARAM_REGEX = regex.concat(\n '(',\n BRACKET_QUOTED_ID_REGEX, '|',\n PLAIN_ID_REGEX,\n ')(?==)'\n );\n\n const HELPER_NAME_OR_PATH_EXPRESSION = { begin: IDENTIFIER_REGEX };\n\n const HELPER_PARAMETER = hljs.inherit(HELPER_NAME_OR_PATH_EXPRESSION, { keywords: LITERALS });\n\n const SUB_EXPRESSION = {\n begin: /\\(/,\n end: /\\)/\n // the \"contains\" is added below when all necessary sub-modes are defined\n };\n\n const HASH = {\n // fka \"attribute-assignment\", parameters of the form 'key=value'\n className: 'attr',\n begin: HASH_PARAM_REGEX,\n relevance: 0,\n starts: {\n begin: /=/,\n end: /=/,\n starts: { contains: [\n hljs.NUMBER_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE,\n HELPER_PARAMETER,\n SUB_EXPRESSION\n ] }\n }\n };\n\n const BLOCK_PARAMS = {\n // parameters of the form '{{#with x as | y |}}...{{/with}}'\n begin: /as\\s+\\|/,\n keywords: { keyword: 'as' },\n end: /\\|/,\n contains: [\n {\n // define sub-mode in order to prevent highlighting of block-parameter named \"as\"\n begin: /\\w+/ }\n ]\n };\n\n const HELPER_PARAMETERS = {\n contains: [\n hljs.NUMBER_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE,\n BLOCK_PARAMS,\n HASH,\n HELPER_PARAMETER,\n SUB_EXPRESSION\n ],\n returnEnd: true\n // the property \"end\" is defined through inheritance when the mode is used. If depends\n // on the surrounding mode, but \"endsWithParent\" does not work here (i.e. it includes the\n // end-token of the surrounding mode)\n };\n\n const SUB_EXPRESSION_CONTENTS = hljs.inherit(HELPER_NAME_OR_PATH_EXPRESSION, {\n className: 'name',\n keywords: BUILT_INS,\n starts: hljs.inherit(HELPER_PARAMETERS, { end: /\\)/ })\n });\n\n SUB_EXPRESSION.contains = [ SUB_EXPRESSION_CONTENTS ];\n\n const OPENING_BLOCK_MUSTACHE_CONTENTS = hljs.inherit(HELPER_NAME_OR_PATH_EXPRESSION, {\n keywords: BUILT_INS,\n className: 'name',\n starts: hljs.inherit(HELPER_PARAMETERS, { end: /\\}\\}/ })\n });\n\n const CLOSING_BLOCK_MUSTACHE_CONTENTS = hljs.inherit(HELPER_NAME_OR_PATH_EXPRESSION, {\n keywords: BUILT_INS,\n className: 'name'\n });\n\n const BASIC_MUSTACHE_CONTENTS = hljs.inherit(HELPER_NAME_OR_PATH_EXPRESSION, {\n className: 'name',\n keywords: BUILT_INS,\n starts: hljs.inherit(HELPER_PARAMETERS, { end: /\\}\\}/ })\n });\n\n const ESCAPE_MUSTACHE_WITH_PRECEEDING_BACKSLASH = {\n begin: /\\\\\\{\\{/,\n skip: true\n };\n const PREVENT_ESCAPE_WITH_ANOTHER_PRECEEDING_BACKSLASH = {\n begin: /\\\\\\\\(?=\\{\\{)/,\n skip: true\n };\n\n return {\n name: 'Handlebars',\n aliases: [\n 'hbs',\n 'html.hbs',\n 'html.handlebars',\n 'htmlbars'\n ],\n case_insensitive: true,\n subLanguage: 'xml',\n contains: [\n ESCAPE_MUSTACHE_WITH_PRECEEDING_BACKSLASH,\n PREVENT_ESCAPE_WITH_ANOTHER_PRECEEDING_BACKSLASH,\n hljs.COMMENT(/\\{\\{!--/, /--\\}\\}/),\n hljs.COMMENT(/\\{\\{!/, /\\}\\}/),\n {\n // open raw block \"{{{{raw}}}} content not evaluated {{{{/raw}}}}\"\n className: 'template-tag',\n begin: /\\{\\{\\{\\{(?!\\/)/,\n end: /\\}\\}\\}\\}/,\n contains: [ OPENING_BLOCK_MUSTACHE_CONTENTS ],\n starts: {\n end: /\\{\\{\\{\\{\\//,\n returnEnd: true,\n subLanguage: 'xml'\n }\n },\n {\n // close raw block\n className: 'template-tag',\n begin: /\\{\\{\\{\\{\\//,\n end: /\\}\\}\\}\\}/,\n contains: [ CLOSING_BLOCK_MUSTACHE_CONTENTS ]\n },\n {\n // open block statement\n className: 'template-tag',\n begin: /\\{\\{#/,\n end: /\\}\\}/,\n contains: [ OPENING_BLOCK_MUSTACHE_CONTENTS ]\n },\n {\n className: 'template-tag',\n begin: /\\{\\{(?=else\\}\\})/,\n end: /\\}\\}/,\n keywords: 'else'\n },\n {\n className: 'template-tag',\n begin: /\\{\\{(?=else if)/,\n end: /\\}\\}/,\n keywords: 'else if'\n },\n {\n // closing block statement\n className: 'template-tag',\n begin: /\\{\\{\\//,\n end: /\\}\\}/,\n contains: [ CLOSING_BLOCK_MUSTACHE_CONTENTS ]\n },\n {\n // template variable or helper-call that is NOT html-escaped\n className: 'template-variable',\n begin: /\\{\\{\\{/,\n end: /\\}\\}\\}/,\n contains: [ BASIC_MUSTACHE_CONTENTS ]\n },\n {\n // template variable or helper-call that is html-escaped\n className: 'template-variable',\n begin: /\\{\\{/,\n end: /\\}\\}/,\n contains: [ BASIC_MUSTACHE_CONTENTS ]\n }\n ]\n };\n}\n\nmodule.exports = handlebars;\n"],"names":["handlebars","hljs","regex","BUILT_INS","LITERALS","DOUBLE_QUOTED_ID_REGEX","SINGLE_QUOTED_ID_REGEX","BRACKET_QUOTED_ID_REGEX","PLAIN_ID_REGEX","PATH_DELIMITER_REGEX","ANY_ID","IDENTIFIER_REGEX","HASH_PARAM_REGEX","HELPER_NAME_OR_PATH_EXPRESSION","HELPER_PARAMETER","SUB_EXPRESSION","HASH","BLOCK_PARAMS","HELPER_PARAMETERS","SUB_EXPRESSION_CONTENTS","OPENING_BLOCK_MUSTACHE_CONTENTS","CLOSING_BLOCK_MUSTACHE_CONTENTS","BASIC_MUSTACHE_CONTENTS","handlebars_1"],"mappings":";4YASA,SAASA,EAAWC,EAAM,CACxB,MAAMC,EAAQD,EAAK,MACbE,EAAY,CAChB,SAAU,WACV,SAAU,CACR,SACA,WACA,aACA,YACA,SACA,W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