File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -154,25 +154,17 @@ var JsDiff = (function() {
154154
155155 var WordDiff = new fbDiff ( true ) ;
156156 WordDiff . tokenize = function ( value ) {
157- return removeEmpty ( value . split ( / ( \s + | \b ) / g ) ) ;
157+ return removeEmpty ( value . split ( / ( \s + | \b ) / ) ) ;
158158 } ;
159159
160160 var CssDiff = new fbDiff ( true ) ;
161161 CssDiff . tokenize = function ( value ) {
162- return removeEmpty ( value . split ( / ( [ { } : ; , ] | \s + ) / g ) ) ;
162+ return removeEmpty ( value . split ( / ( [ { } : ; , ] | \s + ) / ) ) ;
163163 } ;
164164
165165 var LineDiff = new fbDiff ( ) ;
166166 LineDiff . tokenize = function ( value ) {
167- var values = value . split ( / \n / g) ,
168- ret = [ ] ;
169- for ( var i = 0 ; i < values . length - 1 ; i ++ ) {
170- ret . push ( values [ i ] + "\n" ) ;
171- }
172- if ( values . length ) {
173- ret . push ( values [ values . length - 1 ] ) ;
174- }
175- return ret ;
167+ return value . split ( / ^ / m) ;
176168 } ;
177169
178170 return {
You can’t perform that action at this time.
0 commit comments