diff --git a/diff2html.js b/diff2html.js index d9b342b..a346b89 100644 --- a/diff2html.js +++ b/diff2html.js @@ -3,7 +3,7 @@ * Diff to HTML (diff2html.js) * Author: rtfpessoa * Date: Friday 29 August 2014 - * Last Update: Sunday 25 January 2015 + * Last Update: Sunday 2 February 2015 * * Diff command: * git diff @@ -165,6 +165,9 @@ currentFile.oldName = values[1]; } else if (currentFile && !currentFile.newName && (values = /^\+\+\+ b\/(\S+).*$/.exec(line))) { currentFile.newName = values[1]; + + var fileSplit = currentFile.newName.split("."); + currentFile.language = fileSplit[fileSplit.length - 1]; } else if (currentFile && startsWith(line, "@@")) { startBlock(line); } else if (currentBlock) { @@ -185,7 +188,7 @@ var generateJsonHtml = function (diffFiles) { return "