fix diff ignore space

This commit is contained in:
nazoking
2015-06-08 01:33:22 +09:00
parent d38dfee540
commit 88080c8d02

View File

@@ -109,7 +109,7 @@ function JsDiffRender(params){
var headTextLines = (params.newText==="")?[]:params.newText.split(/\r\n|\r|\n/);
var sm, ctx;
if(params.ignoreSpace){
var ignoreSpace = function(a){ return a.replace(/\s+/,' ').replace(/^\s+|\s+$/,''); };
var ignoreSpace = function(a){ return a.replace(/\s+/g,''); };
sm = new difflib.SequenceMatcher(
$.map(baseTextLines, ignoreSpace),
$.map(headTextLines, ignoreSpace));