Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -78,14 +78,14 @@ |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 19 ), |
80 | 80 | array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 97 ), |
81 | 81 | array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 11 ), |
82 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 43 ), |
| 82 | + array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 44 ), |
83 | 83 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 3 ), |
84 | 84 | ), |
85 | 85 | 'combined' => array( |
86 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 313 ), |
| 86 | + array( 'src' => 'js/plugins.combined.js', 'version' => 314 ), |
87 | 87 | ), |
88 | 88 | 'minified' => array( |
89 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 313 ), |
| 89 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 314 ), |
90 | 90 | ), |
91 | 91 | ), |
92 | 92 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js |
— | — | @@ -556,10 +556,14 @@ |
557 | 557 | sanatizedStr.substring( endBraces.index + 2 ); |
558 | 558 | } |
559 | 559 | |
| 560 | + |
560 | 561 | //treat HTML comments like whitespace |
561 | 562 | while ( sanatizedStr.indexOf( '<!' ) != -1 ) { |
562 | 563 | startIndex = sanatizedStr.indexOf( '<!' ); |
563 | 564 | endIndex = sanatizedStr.indexOf('-->') + 3; |
| 565 | + if( endIndex < 3 ){ |
| 566 | + break; |
| 567 | + } |
564 | 568 | sanatizedSegment = sanatizedStr.substring( startIndex,endIndex ).replace( /\S/g , ' ' ); |
565 | 569 | sanatizedStr = |
566 | 570 | sanatizedStr.substring( 0, startIndex ) + sanatizedSegment + sanatizedStr.substring( endIndex ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -9669,10 +9669,14 @@ |
9670 | 9670 | sanatizedStr.substring( endBraces.index + 2 ); |
9671 | 9671 | } |
9672 | 9672 | |
| 9673 | + |
9673 | 9674 | //treat HTML comments like whitespace |
9674 | 9675 | while ( sanatizedStr.indexOf( '<!' ) != -1 ) { |
9675 | 9676 | startIndex = sanatizedStr.indexOf( '<!' ); |
9676 | 9677 | endIndex = sanatizedStr.indexOf('-->') + 3; |
| 9678 | + if( endIndex < 3 ){ |
| 9679 | + break; |
| 9680 | + } |
9677 | 9681 | sanatizedSegment = sanatizedStr.substring( startIndex,endIndex ).replace( /\S/g , ' ' ); |
9678 | 9682 | sanatizedStr = |
9679 | 9683 | sanatizedStr.substring( 0, startIndex ) + sanatizedSegment + sanatizedStr.substring( endIndex ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -664,7 +664,8 @@ |
665 | 665 | if(wikitext.match(/\s*{{\s*\S*:/)){collapsible=false;} |
666 | 666 | var sanatizedStr=wikitext.replace(/{{/," ");endBraces=sanatizedStr.match(/}}\s*$/);if(endBraces){sanatizedStr=sanatizedStr.substring(0,endBraces.index)+" "+ |
667 | 667 | sanatizedStr.substring(endBraces.index+2);} |
668 | | -while(sanatizedStr.indexOf('<!')!=-1){startIndex=sanatizedStr.indexOf('<!');endIndex=sanatizedStr.indexOf('-->')+3;sanatizedSegment=sanatizedStr.substring(startIndex,endIndex).replace(/\S/g,' ');sanatizedStr=sanatizedStr.substring(0,startIndex)+sanatizedSegment+sanatizedStr.substring(endIndex);} |
| 668 | +while(sanatizedStr.indexOf('<!')!=-1){startIndex=sanatizedStr.indexOf('<!');endIndex=sanatizedStr.indexOf('-->')+3;if(endIndex<3){break;} |
| 669 | +sanatizedSegment=sanatizedStr.substring(startIndex,endIndex).replace(/\S/g,' ');sanatizedStr=sanatizedStr.substring(0,startIndex)+sanatizedSegment+sanatizedStr.substring(endIndex);} |
669 | 670 | while(sanatizedStr.indexOf('{{')!=-1){startIndex=sanatizedStr.indexOf('{{')+1;openBraces=2;endIndex=startIndex;while((openBraces>0)&&(endIndex<sanatizedStr.length)){var brace=sanatizedStr[++endIndex];openBraces+=brace=='}'?-1:brace=='{'?1:0;} |
670 | 671 | sanatizedSegment=sanatizedStr.substring(startIndex,endIndex).replace(/[{}|=]/g,'X');sanatizedStr=sanatizedStr.substring(0,startIndex)+sanatizedSegment+sanatizedStr.substring(endIndex);} |
671 | 672 | while(sanatizedStr.indexOf('[[')!=-1){startIndex=sanatizedStr.indexOf('[[')+1;openBraces=2;endIndex=startIndex;while((openBraces>0)&&(endIndex<sanatizedStr.length)){var brace=sanatizedStr[++endIndex];openBraces+=brace==']'?-1:brace=='['?1:0;} |