Skip to content

Commit 13ce98d

Browse files
committed
Fix some bugs
1 parent b0e63f9 commit 13ce98d

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

lib/diff-logger.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function getDiffText(diff, options) {
2020
var charsAroundDiff = options.charsAroundDiff,
2121
output = '';
2222

23-
if (charsAroundDiff > 0) {
23+
if (charsAroundDiff < 0) {
2424
charsAroundDiff = 20;
2525
}
2626

@@ -35,7 +35,7 @@ function getDiffText(diff, options) {
3535
if (part.removed) color = 'red';
3636

3737
if (color !== 'grey') {
38-
output += (!index ? '\n' : '') + partValue[color];
38+
output += (!index ? '\n' : '') + partValue[color];
3939

4040
return;
4141
}

lib/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ HtmlDiffer.prototype.diffHtml = function(html1, html2, options) {
142142
console.warn('WARNING! The third param of "diffHtml" method is deprecated!');
143143
}
144144

145+
options = _.defaults(this.options, options);
146+
145147
var htmlDiffer = new HtmlDiff(options);
146148

147149
return htmlDiffer.diff(html1, html2);

lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ exports.parseAttr = function(val, isClick) {
3838
};
3939

4040
/**
41-
* Sorts the gieven CSS class attribute
41+
* Sorts the given CSS class attribute
4242
* @param {String} cssClasses
4343
* @returns {String}
4444
*/

0 commit comments

Comments
 (0)