Permalink
Browse files

Fix JS highlight rules

  • Loading branch information...
1 parent b7aac28 commit 255bb498342640d4f36bfc12a268498edf2132ec @gjtorikian gjtorikian committed Oct 6, 2012
Showing with 26 additions and 6 deletions.
  1. +26 −6 lib/ace/mode/jade_highlight_rules.js
View
32 lib/ace/mode/jade_highlight_rules.js
@@ -120,11 +120,11 @@ var JadeHighlightRules = function() {
"token": [ "storage.type.function.jade", "entity.name.function.jade"],
"regex": "^(\\s*mixin)( [\\w\\-]+)"
},
- /* {
+ {
"token": "source.js.embedded.jade",
- "regex": "^\\s*-|=|!=",
- "next": "js_code"
- },*/
+ "regex": "^\\s*(?:-|=|!=)",
+ "next": "js-start"
+ },
/*{
"token": "entity.name.tag.script.jade",
"regex": "^\\s*script",
@@ -219,7 +219,21 @@ var JadeHighlightRules = function() {
"next": "start"
}
],
- "tag_attributes": [
+ "tag_attributes": [
+ {
+ "token" : "string",
+ "regex" : "'(?=.)",
+ "next" : "qstring"
+ },
+ {
+ "token" : "string",
+ "regex" : '"(?=.)',
+ "next" : "qqstring"
+ },
+ {
+ "token": "entity.other.attribute-name.jade",
+ "regex": "\\b[a-zA-Z\\-:]+"
+ },
{
"token": ["entity.other.attribute-name.jade", "punctuation"],
"regex": "\\b([a-zA-Z:\\.-]+)(=)",
@@ -284,6 +298,12 @@ var JadeHighlightRules = function() {
}
]
};
+
+ this.embedRules(JavaScriptHighlightRules, "js-", [{
+ token: "text",
+ regex: ".$",
+ next: "start"
+ }]);
/*
this.embedRules(MarkdownHighlightRules, "markdown-", [{
token : "support.function",
@@ -324,4 +344,4 @@ var JadeHighlightRules = function() {
oop.inherits(JadeHighlightRules, TextHighlightRules);
exports.JadeHighlightRules = JadeHighlightRules;
-});
+});

0 comments on commit 255bb49

Please sign in to comment.