git ssb

0+

Dominic / yap-patch



Tree: 6e363b31bb003c462fcb03b5171f59598dedf0f4

Files: 6e363b31bb003c462fcb03b5171f59598dedf0f4 / messages / post.js

648 bytesRaw
1var htmlEscape = require('html-escape')
2
3var u = require('yap-util')
4
5module.exports = u.createRenderer(function render (data, apply) {
6 var since = apply.since
7 var time = data.value.timestamp || data.timestamp
8 return apply('messageLayout', {
9 id: data.key,
10 author: data.value.author,
11 ts: time,
12 content: u.markdown(data.value.content),
13 meta: [
14 data.value.content.channel
15 && ['a', {href: toUrl('patch/public', {channel: data.value.content.channel})}, '#'+data.value.content.channel],
16 ['a', {href: toUrl('patch/thread', {id: data.value.content.root || data.key})}, 'Thread']
17 ].filter(Boolean),
18 })
19})
20

Built with git-ssb-web