From 42b3235a5d24edd063c19d567011bf45045f1d94 Mon Sep 17 00:00:00 2001 From: ignite1771 Date: Fri, 25 Dec 2020 19:32:48 +0800 Subject: [PATCH] Fix multiple paragraph tags of 'log' and 'show' Replace '\n' with '
so as to get rid of

tags with every line, and avoid to directly write the template in the function. --- src/js/git/index.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/js/git/index.js b/src/js/git/index.js index b8f95ef8..b6a9355c 100644 --- a/src/js/git/index.js +++ b/src/js/git/index.js @@ -2922,30 +2922,27 @@ var Commit = Backbone.Model.extend({ }, getLogEntry: function() { - // for now we are just joining all these things with newlines which - // will get placed by paragraph tags. Not really a fan of this, but - // it's better than making an entire template and all that jazz return [ 'Author: ' + this.get('author'), 'Date: ' + this.get('createTime'), - '
', + '', this.get('commitMessage'), - '
', + '', 'Commit: ' + this.get('id') - ].join('\n' ) + '\n'; + ].join('
') + '\n'; }, getShowEntry: function() { // same deal as above, show log entry and some fake changes return [ - this.getLogEntry(), + this.getLogEntry().replace('\n', ''), 'diff --git a/bigGameResults.html b/bigGameResults.html', '--- bigGameResults.html', '+++ bigGameResults.html', '@@ 13,27 @@ Winner, Score', '- Stanfurd, 14-7', '+ Cal, 21-14' - ].join('\n') + '\n'; + ].join('
') + '\n'; }, validateAtInit: function() {