Permalink
Browse files

Merge pull request #1016 from ajaxorg/mode/jade

Fix JS highlight rules embedded in Jade
  • Loading branch information...
2 parents 4fee6a4 + 255bb49 commit 063e8442a34d5e8183e68de45caef21a7c408746 @nightwing nightwing committed Oct 18, 2012
Showing with 26 additions and 6 deletions.
  1. +26 −6 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 063e844

Please sign in to comment.