Files: 35b6122037e20c7e9f0d9b54e257f4ade57b49b7 / messages / post.js
648 bytesRaw
1 | var htmlEscape = require('html-escape') |
2 | |
3 | var u = require('yap-util') |
4 | |
5 | module.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