kopia lustrzana https://github.com/c9/core
fix matching bracket highlighting in js templates
rodzic
687d5838b2
commit
f5fe64d1f2
|
@ -93,3 +93,8 @@ z=<div {...this.props} x={1 + 2} y="z{a}b&" t={
|
|||
1 <a> { ++x } </a>
|
||||
</div>
|
||||
|
||||
var o = {
|
||||
t:`${[].map(x => {
|
||||
return x
|
||||
})}`
|
||||
};
|
|
@ -686,5 +686,45 @@
|
|||
],[
|
||||
"start"
|
||||
],[
|
||||
"start"
|
||||
"start",
|
||||
["storage.type","var"],
|
||||
["text"," "],
|
||||
["identifier","o"],
|
||||
["text"," "],
|
||||
["keyword.operator","="],
|
||||
["text"," "],
|
||||
["paren.lparen","{"]
|
||||
],[
|
||||
["start","no_regex","start","string.quasi.start","string.quasi.start","no_regex"],
|
||||
["text"," "],
|
||||
["identifier","t"],
|
||||
["punctuation.operator",":"],
|
||||
["string.quasi.start","`"],
|
||||
["paren.quasi.start","${"],
|
||||
["paren.lparen","["],
|
||||
["paren.rparen","]"],
|
||||
["punctuation.operator","."],
|
||||
["identifier","map"],
|
||||
["paren.lparen","("],
|
||||
["identifier","x"],
|
||||
["text"," "],
|
||||
["keyword.operator","=>"],
|
||||
["text"," "],
|
||||
["paren.lparen","{"]
|
||||
],[
|
||||
["#tmp","no_regex","start","no_regex","start","string.quasi.start","string.quasi.start","no_regex"],
|
||||
["text"," "],
|
||||
["keyword","return"],
|
||||
["text"," "],
|
||||
["identifier","x"]
|
||||
],[
|
||||
"no_regex",
|
||||
["text"," "],
|
||||
["paren.rparen","})"],
|
||||
["paren.quasi.end","}"],
|
||||
["string.quasi.end","`"]
|
||||
],[
|
||||
"start",
|
||||
["paren.rparen","}"],
|
||||
["punctuation.operator",";"]
|
||||
]]
|
|
@ -354,9 +354,8 @@ var JavaScriptHighlightRules = function(options) {
|
|||
this.next = val == "{" ? this.nextState : "";
|
||||
if (val == "{" && stack.length) {
|
||||
stack.unshift("start", state);
|
||||
return "paren";
|
||||
}
|
||||
if (val == "}" && stack.length) {
|
||||
else if (val == "}" && stack.length) {
|
||||
stack.shift();
|
||||
this.next = stack.shift();
|
||||
if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
|
||||
|
|
Ładowanie…
Reference in New Issue