mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 08:10:35 +00:00
Make modified newlines visible by replacing empty lines with a space
Change-Id: If7b811245e0d01a7a147ab54c3801fc1754730a9
This commit is contained in:
parent
1876d785a7
commit
bc1a77a812
|
@ -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 ) );
|
||||
|
|
Loading…
Reference in a new issue