Skip to content

Commit 1e22a3e

Browse files
committed
Release version 2.0.7
1 parent 7d02e67 commit 1e22a3e

File tree

6 files changed

+20
-7
lines changed

6 files changed

+20
-7
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "diff2html",
3-
"version": "2.0.6",
3+
"version": "2.0.7",
44
"homepage": "https://diff2html.xyz",
55
"description": "Fast Diff to colorized HTML",
66
"keywords": [

dist/diff2html-ui.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@
3333

3434
Diff2HtmlUI.prototype.draw = function(targetId, config) {
3535
var cfg = config || {};
36+
cfg.inputFormat = 'json';
3637
var $target = this._getTarget(targetId);
3738
$target.html(Diff2Html.getPrettyHtml(diffJson, cfg));
3839

39-
synchronisedScroll($target, config);
40+
synchronisedScroll($target, cfg);
4041
};
4142

4243
function synchronisedScroll($target, config) {

dist/diff2html-ui.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/diff2html.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2572,6 +2572,8 @@ process.umask = function() { return 0; };
25722572
var dissimilarityIndex = /^dissimilarity index (\d+)%/;
25732573
var index = /^index ([0-9a-z]+)\.\.([0-9a-z]+)\s*(\d{6})?/;
25742574

2575+
var binaryFiles = /^Binary files (.*) and (.*) differ/;
2576+
25752577
/* Combined Diff */
25762578
var combinedIndex = /^index ([0-9a-z]+),([0-9a-z]+)\.\.([0-9a-z]+)/;
25772579
var combinedMode = /^mode (\d{6}),(\d{6})\.\.(\d{6})/;
@@ -2701,6 +2703,10 @@ process.umask = function() { return 0; };
27012703
currentFile.newName = values[1];
27022704
}
27032705
currentFile.isRename = true;
2706+
} else if ((values = binaryFiles.exec(line))) {
2707+
currentFile.isBinary = true;
2708+
currentFile.oldName = _getFilename(null, values[1], [config.srcPrefix]);
2709+
currentFile.newName = _getFilename(null, values[2], [config.dstPrefix]);
27042710
} else if ((values = similarityIndex.exec(line))) {
27052711
currentFile.unchangedPercentage = values[1];
27062712
} else if ((values = dissimilarityIndex.exec(line))) {
@@ -2760,7 +2766,12 @@ process.umask = function() { return 0; };
27602766
}
27612767

27622768
function _getFilename(linePrefix, line, prefixes) {
2763-
var FilenameRegExp = new RegExp('^' + linePrefix + ' "?(.+?)"?$');
2769+
var FilenameRegExp;
2770+
if (linePrefix) {
2771+
FilenameRegExp = new RegExp('^' + linePrefix + ' "?(.+?)"?$');
2772+
} else {
2773+
FilenameRegExp = new RegExp('^"?(.+?)"?$');
2774+
}
27642775

27652776
var filename;
27662777
var values = FilenameRegExp.exec(line);

dist/diff2html.min.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "diff2html",
3-
"version": "2.0.6",
3+
"version": "2.0.7",
44
"homepage": "https://diff2html.xyz",
55
"description": "Fast Diff to colorized HTML",
66
"keywords": [

0 commit comments

Comments
 (0)