git ssb

16+

Dominic / patchbay



Tree: 25a8b716544bd1f58eeba52a1feb6bb5a6eb78ae

Files: 25a8b716544bd1f58eeba52a1feb6bb5a6eb78ae / modules_basic / post.js

724 bytesRaw
1var markdown = require('ssb-markdown')
2var h = require('hyperscript')
3var u = require('../util')
4var ref = require('ssb-ref')
5
6//render a message
7
8//var plugs = require('../plugs')
9//var message_link = plugs.first(exports.message_link = [])
10//var markdown = plugs.first(exports.markdown = [])
11//
12
13exports.needs = { message_link: 'first', markdown: 'first' }
14
15exports.gives = 'message_content'
16
17exports.create = function (api) {
18 return function (data) {
19 if(!data.value.content || !data.value.content.text) return
20
21 var root = data.value.content.root
22 var re = !root ? null : h('span', 're: ', api.message_link(root))
23
24 return h('div',
25 re,
26 api.markdown(data.value.content)
27 )
28
29 }
30}
31
32
33
34
35
36
37
38
39
40
41
42
43
44

Built with git-ssb-web