kopia lustrzana https://github.com/c9/core
fix jade mode
rodzic
83d122faea
commit
8e48f77a13
|
@ -95,7 +95,7 @@
|
|||
["meta.tag.any.jade"," test"],
|
||||
["punctuation","("],
|
||||
["entity.other.attribute-name.jade","id"],
|
||||
["text","="],
|
||||
["punctuation","="],
|
||||
["string","\"tag\""],
|
||||
["punctuation",")"]
|
||||
],[
|
||||
|
@ -103,15 +103,15 @@
|
|||
["meta.tag.any.jade"," header"],
|
||||
["punctuation","("],
|
||||
["entity.other.attribute-name.jade","id"],
|
||||
["text","="],
|
||||
["punctuation","="],
|
||||
["string","\"tag\""],
|
||||
["text",", "],
|
||||
["entity.other.attribute-name.jade","blah"],
|
||||
["text","="],
|
||||
["punctuation","="],
|
||||
["string","\"foo\""],
|
||||
["text",", "],
|
||||
["entity.other.attribute-name.jade","meh"],
|
||||
["text","="],
|
||||
["punctuation","="],
|
||||
["string","\"aads\""],
|
||||
["punctuation",")"]
|
||||
],[
|
||||
|
|
|
@ -230,13 +230,9 @@ var JadeHighlightRules = function() {
|
|||
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:\\.-]+)(=)",
|
||||
regex: "([a-zA-Z:\\.-]+)(=)?",
|
||||
next: "attribute_strings"
|
||||
},
|
||||
{
|
||||
|
@ -255,6 +251,11 @@ var JadeHighlightRules = function() {
|
|||
token : "string",
|
||||
regex : '"(?=.)',
|
||||
next : "qqstring"
|
||||
},
|
||||
{
|
||||
token : "string",
|
||||
regex : '(?=\\S)',
|
||||
next : "tag_attributes"
|
||||
}
|
||||
],
|
||||
"qqstring" : [
|
||||
|
|
|
@ -213,6 +213,11 @@ var Tokenizer = function(rules) {
|
|||
if (lastCapture.end != null && /^\)*$/.test(src.substr(lastCapture.end)))
|
||||
src = src.substring(0, lastCapture.start) + src.substr(lastCapture.end);
|
||||
}
|
||||
|
||||
// this is needed for regexps that can match in multiple ways
|
||||
if (src.charAt(0) != "^") src = "^" + src;
|
||||
if (src.charAt(src.length - 1) != "$") src += "$";
|
||||
|
||||
return new RegExp(src, (flag||"").replace("g", ""));
|
||||
};
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue