Using indexOf to check nestTagExceptions

No need to use for loop here, instead use indexOf to check tagString is
an array item within nestTagExceptions
This commit is contained in:
Matt Pass
2012-09-29 16:47:30 +01:00
parent 1257ed0174
commit 30a97ed4db

View File

@@ -139,10 +139,8 @@ function createNewCMInstance(num) {
if (tok.string!=">") {lastString=tok.string};
if (e.type=="keyup"&&e.keyCode=="16"&&lastKeyCode=="190") {
canDoEndTag=true;
for (i=0;i<top.ICEcoder.tagNestExceptions.length;i++) {
if(top.ICEcoder.tagString!="script" && top.ICEcoder.tagString==top.ICEcoder.tagNestExceptions[i]) {
if (top.ICEcoder.tagString!="script" && top.ICEcoder.tagNestExceptions.indexOf(top.ICEcoder.tagString)>-1) {
canDoEndTag=false;
}
}
if (
top.ICEcoder.tagString.slice(0,1)=="/"||