r64074 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64073‎ | r64074 | r64075 >
Date:14:39, 23 March 2010
Author:catrope
Status:ok
Tags:
Comment:
UsabilityInitiative: Fix regex in templateEditor incorrectly detecting stuff like {{citeweb|url=http://www.example.com}} as parser function calls
Modified paths:
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -78,14 +78,14 @@
7979 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 22 ),
8080 array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 98 ),
8181 array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 11 ),
82 - array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 70 ),
 82+ array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 71 ),
8383 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 5 ),
8484 ),
8585 'combined' => array(
86 - array( 'src' => 'js/plugins.combined.js', 'version' => 360 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 361 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 360 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 361 ),
9090 ),
9191 ),
9292 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js
@@ -649,7 +649,7 @@
650650 };
651651
652652 // Whitespace* {{ whitespace* nonwhitespace:
653 - if ( wikitext.match( /\s*{{\s*\S*:/ ) ) {
 653+ if ( wikitext.match( /\s*{{\s*[^\s|]*:/ ) ) {
654654 collapsible = false; // is a parser function
655655 }
656656 /*
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -9958,7 +9958,7 @@
99599959 };
99609960
99619961 // Whitespace* {{ whitespace* nonwhitespace:
9962 - if ( wikitext.match( /\s*{{\s*\S*:/ ) ) {
 9962+ if ( wikitext.match( /\s*{{\s*[^\s|]*:/ ) ) {
99639963 collapsible = false; // is a parser function
99649964 }
99659965 /*
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -679,7 +679,7 @@
680680 this.getOriginalText=function(){return wikitext;};this.getText=function(){newText="";for(i=0;i<ranges.length;i++){if(typeof ranges[i].newVal=='undefined'){newText+=wikitext.substring(ranges[i].begin,ranges[i].end);}else{newText+=ranges[i].newVal;}}
681681 return newText;};this.isCollapsible=function(){return collapsible;}
682682 this.updateRanges=function(){var adjustment=0;for(var i=0;i<ranges.length;i++){ranges[i].begin+=adjustment;if(typeof ranges[i].adjust!='undefined'){adjustment+=ranges[i].adjust();delete ranges[i].adjust;}
683 -ranges[i].end+=adjustment;}};if(wikitext.match(/\s*{{\s*\S*:/)){collapsible=false;}
 683+ranges[i].end+=adjustment;}};if(wikitext.match(/\s*{{\s*[^\s|]*:/)){collapsible=false;}
684684 var sanatizedStr=wikitext.replace(/{{/," ");endBraces=sanatizedStr.match(/}}\s*$/);if(endBraces){sanatizedStr=sanatizedStr.substring(0,endBraces.index)+" "+
685685 sanatizedStr.substring(endBraces.index+2);}
686686 while(sanatizedStr.indexOf('<!')!=-1){startIndex=sanatizedStr.indexOf('<!');endIndex=sanatizedStr.indexOf('-->')+3;if(endIndex<3){break;}

Status & tagging log