diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-05-23 23:24:25 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-05-23 23:24:25 -1000 |
commit | d10fc1c7fbc410ec0c4773902251255582e33adc (patch) | |
tree | da43af098d4d11b857f17eaad46c1b0050c8f70d /lib/render.js | |
parent | 6dbfedff2f7246430f4e6da100bc3baed0ef4ce1 (diff) | |
download | patchfoo-d10fc1c7fbc410ec0c4773902251255582e33adc.tar.gz patchfoo-d10fc1c7fbc410ec0c4773902251255582e33adc.zip |
wip: more git
Diffstat (limited to 'lib/render.js')
-rw-r--r-- | lib/render.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/render.js b/lib/render.js index dd6d55e..02d7285 100644 --- a/lib/render.js +++ b/lib/render.js @@ -148,6 +148,14 @@ Render.prototype.formatSize = function (size) { return size.toFixed(2) + ' MB' } +Render.prototype.linkify = function (text) { + var arr = text.split(u.ssbRefRegex) + for (var i = 1; i < arr.length; i += 2) { + arr[i] = h('a', {href: this.toUrl(arr[i])}, arr[i]) + } + return arr +} + Render.prototype.toUrl = function (href) { if (!href) return href var mentions = this._mentions |