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++) {
|
||||
var rule = state[i];
|
||||
if (rule.next) {
|
||||
if (typeof rule.next != "string")
|
||||
rule.nextState = prefix + rule.nextState;
|
||||
else
|
||||
rule.next = prefix + rule.next;
|
||||
if (typeof rule.next != "string") {
|
||||
if (rule.nextState && rule.nextState.indexOf(prefix) !== 0)
|
||||
rule.nextState = prefix + rule.nextState;
|
||||
} else {
|
||||
if (rule.next.indexOf(prefix) !== 0)
|
||||
rule.next = prefix + rule.next;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue