Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Whitespace differences not recognisable in diff #281

Closed
Bartvds opened this Issue · 1 comment

2 participants

@Bartvds

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
Owner

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

@indexzero indexzero closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.