Prevent double prefixing of "included" rules
This commit is contained in:
parent
5a1948a695
commit
5f2ee8b32b
1 changed files with 7 additions and 4 deletions
|
|
@ -56,10 +56,13 @@ var TextHighlightRules = function() {
|
||||||
for (var i = 0; i < state.length; i++) {
|
for (var i = 0; i < state.length; i++) {
|
||||||
var rule = state[i];
|
var rule = state[i];
|
||||||
if (rule.next) {
|
if (rule.next) {
|
||||||
if (typeof rule.next != "string")
|
if (typeof rule.next != "string") {
|
||||||
rule.nextState = prefix + rule.nextState;
|
if (rule.nextState && rule.nextState.indexOf(prefix) !== 0)
|
||||||
else
|
rule.nextState = prefix + rule.nextState;
|
||||||
rule.next = prefix + rule.next;
|
} else {
|
||||||
|
if (rule.next.indexOf(prefix) !== 0)
|
||||||
|
rule.next = prefix + rule.next;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue