Whitespace differences not recognisable in diff #281

Closed
Bartvds opened this Issue Jul 21, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@Bartvds

Bartvds commented Jul 21, 2013

If two string differ on some white space characters this is not visible in the diff, because only the characters are colored. This makes debugging string formatting issues using equality assertions very hard.

Also if you compare two strings on a windows machine and one of the strings has carriage return \r characters blank lines will be inserted between each numbered row of the diff.

edit: we have to apply something like this to get whitespace diff visible:

var debugWhiteSpace = function(str) {
    return str.replace(/\r/g, "\\r").replace(/\n/g, "\\n").replace(/\t/g, "\\t").replace(/ /g, "\\s");
};
@indexzero

This comment has been minimized.

Show comment Hide comment
@indexzero

indexzero Nov 4, 2014

Member

Should be fixed in 0.8.0 since we updated to diff@~1.0.8

Member

indexzero commented Nov 4, 2014

Should be fixed in 0.8.0 since we updated to diff@~1.0.8

@indexzero indexzero closed this Nov 4, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment