git ssb

16+

Dominic / patchbay



Tree: 164ff0f5cab3f959bf2612a84138a9f46df599ee

Files: 164ff0f5cab3f959bf2612a84138a9f46df599ee / modules_basic / post.js

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

Built with git-ssb-web