Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js |
— | — | @@ -378,8 +378,14 @@ |
379 | 379 | if ( currentField.indexOf( '=' ) == -1 ) { |
380 | 380 | // anonymous field, gets a number |
381 | 381 | valueBegin = currentField.match( /\S+/ ); //first nonwhitespace character |
| 382 | + if( valueBegin == null ){ //ie |
| 383 | + continue; |
| 384 | + } |
382 | 385 | valueBeginIndex = valueBegin.index + oldDivider+1; |
383 | 386 | valueEnd = currentField.match( /[^\s]\s*$/ ); //last nonwhitespace character |
| 387 | + if( valueEnd == null ){ //ie |
| 388 | + continue; |
| 389 | + } |
384 | 390 | valueEndIndex = valueEnd.index + oldDivider + 2; |
385 | 391 | ranges.push( new Range( ranges[ranges.length-1].end, |
386 | 392 | valueBeginIndex ) ); //all the chars upto now |
— | — | @@ -408,6 +414,9 @@ |
409 | 415 | nameBeginIndex = nameBegin.index + oldDivider + 1; |
410 | 416 | // Last nonwhitespace and non } character |
411 | 417 | nameEnd = currentName.match( /[^\s]\s*$/ ); |
| 418 | + if( nameEnd == null ){ //ie |
| 419 | + continue; |
| 420 | + } |
412 | 421 | nameEndIndex = nameEnd.index + oldDivider + 2; |
413 | 422 | // All the chars upto now |
414 | 423 | ranges.push( new Range( ranges[ranges.length-1].end, nameBeginIndex ) ); |
— | — | @@ -416,9 +425,15 @@ |
417 | 426 | oldDivider += currentField.indexOf( '=' ) + 1; |
418 | 427 | // First nonwhitespace character |
419 | 428 | valueBegin = currentValue.match( /\S+/ ); |
| 429 | + if( valueBegin == null ){ //ie |
| 430 | + continue; |
| 431 | + } |
420 | 432 | valueBeginIndex = valueBegin.index + oldDivider + 1; |
421 | 433 | // Last nonwhitespace and non } character |
422 | 434 | valueEnd = currentValue.match( /[^\s]\s*$/ ); |
| 435 | + if( valueEnd == null ){ //ie |
| 436 | + continue; |
| 437 | + } |
423 | 438 | valueEndIndex = valueEnd.index + oldDivider + 2; |
424 | 439 | // All the chars upto now |
425 | 440 | equalsIndex = ranges.push( new Range( ranges[ranges.length-1].end, valueBeginIndex) ) - 1; |