git ssb

0+

Dominic / yap-patch



Tree: e440f8c92caaa6857bccee89bb2de11d376d29a3

Files: e440f8c92caaa6857bccee89bb2de11d376d29a3 / 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