You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@suther You may remove whitespaces before calling difflib.SequenceMatcher - with this function you can remove trailing whitespaces:
removeTrailingWhitespace = function(txt) {
var pattern = /\s*$/g;
var newtxt = [];
for(var i=0;i<txt.length;i++) {
newtxt.push(txt[i].replace(pattern, ''));
}
return newtxt;
}
var base = removeTrailingWhitespace( difflib.stringAsLines(basetxt) );
var new = removeTrailingWhitespace( difflib.stringAsLines(newtxt) );
var sm = new difflib.SequenceMatcher(base, new);
(...)
Please make an option to ignore whitespaces and tabs
The text was updated successfully, but these errors were encountered: