Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js |
— | — | @@ -429,6 +429,16 @@ |
430 | 430 | sanatizedStr = sanatizedStr.substring( 0, endBraces.index ) + " " + |
431 | 431 | sanatizedStr.substring( endBraces.index + 2 ); |
432 | 432 | } |
| 433 | + |
| 434 | + //treat HTML comments like whitespace |
| 435 | + while ( sanatizedStr.indexOf( '<!' ) != -1 ) { |
| 436 | + startIndex = sanatizedStr.indexOf( '<!' ); |
| 437 | + endIndex = sanatizedStr.indexOf('-->') + 3; |
| 438 | + sanatizedSegment = sanatizedStr.substring( startIndex,endIndex ).replace( /\S/g , ' ' ); |
| 439 | + sanatizedStr = |
| 440 | + sanatizedStr.substring( 0, startIndex ) + sanatizedSegment + sanatizedStr.substring( endIndex ); |
| 441 | + } |
| 442 | + |
433 | 443 | // Match the open braces we just found with equivalent closing braces note, works for any level of braces |
434 | 444 | while ( sanatizedStr.indexOf( '{{' ) != -1 ) { |
435 | 445 | startIndex = sanatizedStr.indexOf( '{{' ) + 1; |