Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Whitespace differences not recognisable in diff #281

Bartvds opened this Issue · 1 comment

2 participants


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");

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.