Skip to content

Commit

Permalink
Merge pull request #1016 from ajaxorg/mode/jade
Browse files Browse the repository at this point in the history
Fix JS highlight rules embedded in Jade
  • Loading branch information
nightwing committed Oct 18, 2012
2 parents 4fee6a4 + 255bb49 commit 063e844
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions lib/ace/mode/jade_highlight_rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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:\\.-]+)(=)",
Expand Down Expand Up @@ -284,6 +298,12 @@ var JadeHighlightRules = function() {
}
]
};

this.embedRules(JavaScriptHighlightRules, "js-", [{
token: "text",
regex: ".$",
next: "start"
}]);
/*
this.embedRules(MarkdownHighlightRules, "markdown-", [{
token : "support.function",
Expand Down Expand Up @@ -324,4 +344,4 @@ var JadeHighlightRules = function() {
oop.inherits(JadeHighlightRules, TextHighlightRules);

exports.JadeHighlightRules = JadeHighlightRules;
});
});

0 comments on commit 063e844

Please sign in to comment.