diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2019-01-31 15:17:28 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2019-01-31 23:38:04 -1000 |
commit | f45c79b0d6eba673d537ba86b9cd8797666ad4b7 (patch) | |
tree | 6b51e14c1eae3e511dcecf1df4aa3ada8a95723a /lib/render.js | |
parent | d4be33a6f00bd990b75c0ba234a520c272090028 (diff) | |
download | patchfoo-f45c79b0d6eba673d537ba86b9cd8797666ad4b7.tar.gz patchfoo-f45c79b0d6eba673d537ba86b9cd8797666ad4b7.zip |
Add drafts feature
Diffstat (limited to 'lib/render.js')
-rw-r--r-- | lib/render.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/render.js b/lib/render.js index 8f2e56c..b4ca804 100644 --- a/lib/render.js +++ b/lib/render.js @@ -4,6 +4,7 @@ var pull = require('pull-stream') var cat = require('pull-cat') var paramap = require('pull-paramap') var h = require('hyperscript') +var ph = require('pull-hyperscript') var marked = require('ssb-marked') var emojis = require('emoji-named-characters') var qs = require('querystring') @@ -350,6 +351,20 @@ Render.prototype.msgLink = function (msg, cb) { return a } +Render.prototype.phMsgLink = function (msg) { + var self = this + return u.readNext(function (cb) { + self.app.unboxMsg(msg, function (err, msg) { + if (err) return cb(err) + var renderMsg = new RenderMsg(self, self.app, msg, {wrap: false}) + renderMsg.title(function (err, title) { + if (err) return cb(err) + cb(null, ph('a', {href: self.toUrl(msg.key)}, u.escapeHTML(title))) + }) + }) + }) +} + Render.prototype.renderMsg = function (msg, opts, cb) { var self = this self.app.filterMsg(msg, opts, function (err, show) { |