Make modified newlines visible by replacing empty lines with a space

Change-Id: If7b811245e0d01a7a147ab54c3801fc1754730a9
This commit is contained in:
Gabriel Wicke 2012-06-06 17:11:29 +02:00
parent 1876d785a7
commit bc1a77a812

View file

@ -229,6 +229,8 @@ var roundTripDiff = function ( res, src, document ) {
res.write('<pre>' + htmlSpecialChars( out ) + '</pre><hr>');
res.write( '<h2>Diff between original Wikitext (green) and round-tripped wikitext (red)</h2><hr>' );
var patch;
src = src.replace(/\n(?=\n)/g, '\n ');
out = out.replace(/\n(?=\n)/g, '\n ');
if ( src.length < 4000 ) {
// Use word-based diff for small articles
patch = jsDiff.convertChangesToXML( jsDiff.diffWords( src, out ) );