Files: 8dc25143a3f37f1618f7a92b3c46dec512b43bfd / modules / post.js
554 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 | exports.needs = { message_link: 'first', markdown: 'first' } |
7 | |
8 | exports.gives = 'message_content' |
9 | |
10 | exports.create = function (api) { |
11 | return function (data) { |
12 | if(!data.value.content || !data.value.content.text) return |
13 | |
14 | var root = data.value.content.root |
15 | var re = !root ? null : h('span', 're: ', api.message_link(root)) |
16 | |
17 | return h('div', |
18 | re, |
19 | api.markdown(data.value.content) |
20 | ) |
21 | |
22 | } |
23 | } |
24 | |
25 | |
26 | |
27 | |
28 | |
29 | |
30 | |
31 | |
32 | |
33 | |
34 | |
35 | |
36 | |
37 |
Built with git-ssb-web