mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 05:25:50 +01:00
fix diff ignore space
This commit is contained in:
@@ -109,7 +109,7 @@ function JsDiffRender(params){
|
|||||||
var headTextLines = (params.newText==="")?[]:params.newText.split(/\r\n|\r|\n/);
|
var headTextLines = (params.newText==="")?[]:params.newText.split(/\r\n|\r|\n/);
|
||||||
var sm, ctx;
|
var sm, ctx;
|
||||||
if(params.ignoreSpace){
|
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(
|
sm = new difflib.SequenceMatcher(
|
||||||
$.map(baseTextLines, ignoreSpace),
|
$.map(baseTextLines, ignoreSpace),
|
||||||
$.map(headTextLines, ignoreSpace));
|
$.map(headTextLines, ignoreSpace));
|
||||||
|
|||||||
Reference in New Issue
Block a user