aboutsummaryrefslogtreecommitdiff
path: root/lib/render.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-05-23 23:24:25 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-05-23 23:24:25 -1000
commitd10fc1c7fbc410ec0c4773902251255582e33adc (patch)
treeda43af098d4d11b857f17eaad46c1b0050c8f70d /lib/render.js
parent6dbfedff2f7246430f4e6da100bc3baed0ef4ce1 (diff)
downloadpatchfoo-d10fc1c7fbc410ec0c4773902251255582e33adc.tar.gz
patchfoo-d10fc1c7fbc410ec0c4773902251255582e33adc.zip
wip: more git
Diffstat (limited to 'lib/render.js')
-rw-r--r--lib/render.js8
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