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);
(...)
Activity
tbrugz commentedon Apr 12, 2016
@suther You may remove whitespaces before calling
difflib.SequenceMatcher- with this function you can remove trailing whitespaces: