git ssb

16+

Dominic / patchbay



Tree: 7470f29e565172555b9c2e102a58e88dd52a2d6a

Files: 7470f29e565172555b9c2e102a58e88dd52a2d6a / modules_basic / post.js

870 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 = {
16 message_content: true,
17 message_title: true
18}
19
20exports.create = function (api) {
21 return {
22 message_content,
23 message_title
24 }
25
26 function message_content (data) {
27 if(!data.value.content || !data.value.content.text) return
28
29 return h('div',
30 api.markdown(data.value.content)
31 )
32 }
33
34 function message_title (data) {
35 var root = data.value.content && data.value.content.root
36 return !root ? null : h('span', 're: ', api.message_link(root))
37 }
38}
39
40
41
42
43
44
45
46
47
48
49
50
51
52

Built with git-ssb-web