Files: 4cda013d06b86a002895df3cbed747f6baf1085c / modules_basic / post.js
724 bytesRaw
1 | var markdown = require('ssb-markdown') |
2 | var h = require('hyperscript') |
3 | var u = require('../util') |
4 | var 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 | |
13 | exports.needs = { message_link: 'first', markdown: 'first' } |
14 | |
15 | exports.gives = 'message_content' |
16 | |
17 | exports.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