diff options
Diffstat (limited to 'lib/serve.js')
-rw-r--r-- | lib/serve.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/serve.js b/lib/serve.js index 13d3fc5..8f7d1de 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -2693,15 +2693,21 @@ Serve.prototype.wrapBinary = function (opts) { var lineNum = i++ var id = hash + '-' + lineNum var idEnc = encodeURIComponent(id) + var allowComment = self.query.commit && self.query.path return [ ph('tr', [ + ph('td', + allowComment ? ph('a', { + href: '?msg=' + encodeURIComponent(self.query.msg) + + '&commit=' + encodeURIComponent(self.query.commit) + + '&path=' + encodeURIComponent(self.query.path) + + '&comment=' + idEnc + + '#' + idEnc + }, '…') : '' + ), ph('td', ph('a', { name: id, - href: '?msg=' + encodeURIComponent(self.query.msg) - + '&commit=' + encodeURIComponent(self.query.commit) - + '&path=' + encodeURIComponent(self.query.path) - + '&comment=' + idEnc - + '#' + idEnc + href: '#' + idEnc }, String(lineNum))), ph('td', ph('pre', self.app.render.highlight(line, ext))) ]), |