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