diff options
Diffstat (limited to 'lib/render-msg.js')
-rw-r--r-- | lib/render-msg.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js index 8bd3661..51d094e 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -377,15 +377,22 @@ RenderMsg.prototype.gitUpdate = function (cb) { h('ul', self.c.commits.map(function (commit) { return h('li', h('code', String(commit.sha1).substr(0, 8)), ' ', - commit.title, - commit.body ? h('div', - {innerHTML: self.render.markdown('\n' + commit.body)}) : '' + self.linkify(String(commit.title)), + self.gitCommitBody(commit.body) ) })) : '' ), cb) }) } +RenderMsg.prototype.gitCommitBody = function (body) { + if (!body) return '' + var isMarkdown = !/^# Conflicts:$/m.test(body) + return isMarkdown + ? h('div', {innerHTML: this.render.markdown('\n' + body)}) + : h('pre', this.linkify('\n' + body)) +} + RenderMsg.prototype.gitPullRequest = function (cb) { var self = this var done = multicb({pluck: 1, spread: true}) |