Index: trunk/extensions/VisualEditor/tests/parser/parserTests.js |
— | — | @@ -199,6 +199,7 @@ |
200 | 200 | // a few things we ignore for now.. |
201 | 201 | .replace(/\/wiki\/Main_Page/g, 'Main Page') |
202 | 202 | .replace(/(title|class|rel)="[^"]+"/g, '') |
| 203 | + // the expected html has some extra space in tags, strip it |
203 | 204 | .replace(/<a +href/g, '<a href') |
204 | 205 | .replace(/" +>/g, '">'); |
205 | 206 | } catch(e) { |
— | — | @@ -317,6 +318,9 @@ |
318 | 319 | |
319 | 320 | console.log('DIFF'.cyan +': '); |
320 | 321 | |
| 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 | + |
321 | 325 | var colored_diff = patch.split( '\n' ).map( function(line) { |
322 | 326 | // Add some colors to diff output |
323 | 327 | switch( line.charAt(0) ) { |
— | — | @@ -328,7 +332,7 @@ |
329 | 333 | return line; |
330 | 334 | } |
331 | 335 | }).join( "\n" ); |
332 | | - //patch.replace(/^[^\n]*\n[^\n]*\n[^\n]*\n[^\n]*\n/, '') |
| 336 | + |
333 | 337 | |
334 | 338 | console.log( colored_diff ); |
335 | 339 | } |