Skip to content

Commit 1c42e88

Browse files
committed
Tidy up nginx brush.
1 parent 50d100f commit 1c42e88

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

source/jquery.syntax.brush.nginx.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,22 @@
55
// See <jquery.syntax.js> for licensing details.
66

77
Syntax.register('nginx', function(brush) {
8-
var keywords = ["server", "location", "http", "if", "break", "return"];
8+
brush.push({
9+
pattern: /((\w+).*?);/g,
10+
matches: Syntax.extractMatches(
11+
{klass: 'directive', allow: '*'},
12+
{klass: 'function'}
13+
)
14+
});
915

10-
brush.push({pattern: /(\$)[\w]+/g, klass: 'variable'});
16+
brush.push({
17+
pattern: /(\w+).*?{/g,
18+
matches: Syntax.extractMatches(
19+
{klass: 'keyword'}
20+
)
21+
});
1122

12-
brush.push(keywords, {klass: 'keyword'});
23+
brush.push({pattern: /(\$)[\w]+/g, klass: 'variable'});
1324

1425
brush.push(Syntax.lib.perlStyleComment);
1526
brush.push(Syntax.lib.singleQuotedString);

0 commit comments

Comments
 (0)