1 | hljs.registerLanguage("nginx",(()=>{"use strict";return e=>{const n={
|
2 | className:"variable",variants:[{begin:/\$\d+/},{begin:/\$\{/,end:/\}/},{
|
3 | begin:/[$@]/+e.UNDERSCORE_IDENT_RE}]},a={endsWithParent:!0,keywords:{
|
4 | $pattern:"[a-z/_]+",
|
5 | literal:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"
|
6 | },relevance:0,illegal:"=>",contains:[e.HASH_COMMENT_MODE,{className:"string",
|
7 | contains:[e.BACKSLASH_ESCAPE,n],variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/
|
8 | }]},{begin:"([a-z]+):/",end:"\\s",endsWithParent:!0,excludeEnd:!0,contains:[n]
|
9 | },{className:"regexp",contains:[e.BACKSLASH_ESCAPE,n],variants:[{begin:"\\s\\^",
|
10 | end:"\\s|\\{|;",returnEnd:!0},{begin:"~\\*?\\s+",end:"\\s|\\{|;",returnEnd:!0},{
|
11 | begin:"\\*(\\.[a-z\\-]+)+"},{begin:"([a-z\\-]+\\.)+\\*"}]},{className:"number",
|
12 | begin:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{
|
13 | className:"number",begin:"\\b\\d+[kKmMgGdshdwy]*\\b",relevance:0},n]};return{
|
14 | name:"Nginx config",aliases:["nginxconf"],contains:[e.HASH_COMMENT_MODE,{
|
15 | begin:e.UNDERSCORE_IDENT_RE+"\\s+\\{",returnBegin:!0,end:/\{/,contains:[{
|
16 | className:"section",begin:e.UNDERSCORE_IDENT_RE}],relevance:0},{
|
17 | begin:e.UNDERSCORE_IDENT_RE+"\\s",end:";|\\{",returnBegin:!0,contains:[{
|
18 | className:"attribute",begin:e.UNDERSCORE_IDENT_RE,starts:a}],relevance:0}],
|
19 | illegal:"[^\\s\\}]"}}})()); |
\ | No newline at end of file |