r104712 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104711‎ | r104712 | r104713 >
Date:18:21, 30 November 2011
Author:gwicke
Status:ok (Comments)
Tags:
Comment:
Strip the patch header lines, don't really need those
Modified paths:
  • /trunk/extensions/VisualEditor/tests/parser/parserTests.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/tests/parser/parserTests.js
@@ -199,6 +199,7 @@
200200 // a few things we ignore for now..
201201 .replace(/\/wiki\/Main_Page/g, 'Main Page')
202202 .replace(/(title|class|rel)="[^"]+"/g, '')
 203+ // the expected html has some extra space in tags, strip it
203204 .replace(/<a +href/g, '<a href')
204205 .replace(/" +>/g, '">');
205206 } catch(e) {
@@ -317,6 +318,9 @@
318319
319320 console.log('DIFF'.cyan +': ');
320321
 322+ // Strip the header from the patch, we know how diffs work..
 323+ patch = patch.replace(/^[^\n]*\n[^\n]*\n[^\n]*\n[^\n]*\n/, '');
 324+
321325 var colored_diff = patch.split( '\n' ).map( function(line) {
322326 // Add some colors to diff output
323327 switch( line.charAt(0) ) {
@@ -328,7 +332,7 @@
329333 return line;
330334 }
331335 }).join( "\n" );
332 - //patch.replace(/^[^\n]*\n[^\n]*\n[^\n]*\n[^\n]*\n/, '')
 336+
333337
334338 console.log( colored_diff );
335339 }

Comments

#Comment by Hashar (talk | contribs)   21:33, 30 November 2011

Ah thanks! I was wondering what that line was for :-p

Status & tagging log