git ssb

16+

Dominic / patchbay



Tree: 4867d771b3d4e27e3e132a5f65ecdfb8990fe925

Files: 4867d771b3d4e27e3e132a5f65ecdfb8990fe925 / 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