summaryrefslogtreecommitdiff
path: root/live/static/hl/languages/handlebars.min.js
blob: 3ee9593050a5948310a64c09927c15bdcefd5169 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
hljs.registerLanguage("handlebars",(()=>{"use strict";function e(...e){
return e.map((e=>{return(n=e)?"string"==typeof n?n:n.source:null;var n
})).join("")}return n=>{const a={
"builtin-name":"action bindattr collection component concat debugger each each-in get hash if in input link-to loc log lookup mut outlet partial query-params render template textarea unbound unless view with yield"
},s=/\[.*?\]/,t=/[^\s!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]+/,i=e("(",/'.*?'/,"|",/".*?"/,"|",s,"|",t,"|",/\.|\//,")+"),r=e("(",s,"|",t,")(?==)"),l={
begin:i,lexemes:/[\w.\/]+/},c=n.inherit(l,{keywords:{
literal:"true false undefined null"}}),o={begin:/\(/,end:/\)/},m={
className:"attr",begin:r,relevance:0,starts:{begin:/=/,end:/=/,starts:{
contains:[n.NUMBER_MODE,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,c,o]}}},d={
contains:[n.NUMBER_MODE,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,{begin:/as\s+\|/,
keywords:{keyword:"as"},end:/\|/,contains:[{begin:/\w+/}]},m,c,o],returnEnd:!0
},g=n.inherit(l,{className:"name",keywords:a,starts:n.inherit(d,{end:/\)/})})
;o.contains=[g];const b=n.inherit(l,{keywords:a,className:"name",
starts:n.inherit(d,{end:/\}\}/})}),u=n.inherit(l,{keywords:a,className:"name"
}),h=n.inherit(l,{className:"name",keywords:a,starts:n.inherit(d,{end:/\}\}/})})
;return{name:"Handlebars",
aliases:["hbs","html.hbs","html.handlebars","htmlbars"],case_insensitive:!0,
subLanguage:"xml",contains:[{begin:/\\\{\{/,skip:!0},{begin:/\\\\(?=\{\{)/,
skip:!0},n.COMMENT(/\{\{!--/,/--\}\}/),n.COMMENT(/\{\{!/,/\}\}/),{
className:"template-tag",begin:/\{\{\{\{(?!\/)/,end:/\}\}\}\}/,contains:[b],
starts:{end:/\{\{\{\{\//,returnEnd:!0,subLanguage:"xml"}},{
className:"template-tag",begin:/\{\{\{\{\//,end:/\}\}\}\}/,contains:[u]},{
className:"template-tag",begin:/\{\{#/,end:/\}\}/,contains:[b]},{
className:"template-tag",begin:/\{\{(?=else\}\})/,end:/\}\}/,keywords:"else"},{
className:"template-tag",begin:/\{\{(?=else if)/,end:/\}\}/,keywords:"else if"
},{className:"template-tag",begin:/\{\{\//,end:/\}\}/,contains:[u]},{
className:"template-variable",begin:/\{\{\{/,end:/\}\}\}/,contains:[h]},{
className:"template-variable",begin:/\{\{/,end:/\}\}/,contains:[h]}]}}})());