aboutsummaryrefslogtreecommitdiff
path: root/lib/render.js
diff options
context:
space:
mode:
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