From 1ad5e66be0f022c14f2fcc1153d301421299fa4c Mon Sep 17 00:00:00 2001 From: nightwing Date: Wed, 16 Jul 2014 23:27:20 +0400 Subject: [PATCH] fix #2051 highlighting php string in script tag --- lib/ace/tokenizer.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/ace/tokenizer.js b/lib/ace/tokenizer.js index 64bf59e8..85fa6c7b 100644 --- a/lib/ace/tokenizer.js +++ b/lib/ace/tokenizer.js @@ -268,11 +268,14 @@ var Tokenizer = function(rules) { type = rule.token; if (rule.next) { - if (typeof rule.next == "string") + if (typeof rule.next == "string") { + if (stack.length && stack[0] == currentState && stack[1] == rule.next) + stack.shift(); currentState = rule.next; - else + } else { currentState = rule.next(currentState, stack); - + } + state = this.states[currentState]; if (!state) { window.console && console.error && console.error(currentState, "doesn't exist");