git ssb

7+

dinoworm ๐Ÿ› / patchcore



Tree: 4d1aa8528ed9342d5d663af75cb08beb82f0fbcc

Files: 4d1aa8528ed9342d5d663af75cb08beb82f0fbcc / message / html / render / issue.js

798 bytesRaw
1var h = require('mutant/h')
2var nest = require('depnest')
3var extend = require('xtend')
4
5exports.needs = nest({
6 'message.html': {
7 decorate: 'reduce',
8 layout: 'first',
9 link: 'first',
10 markdown: 'first'
11 }
12})
13
14exports.gives = nest('message.html.render')
15
16exports.create = function (api) {
17 return nest('message.html.render', function renderMessage (msg, opts) {
18 if (msg.value.content.type !== 'issue') return
19 var element = api.message.html.layout(msg, extend({
20 content: messageContent(msg),
21 layout: 'default'
22 }, opts))
23
24 return api.message.html.decorate(element, { msg })
25 })
26
27 function messageContent (data) {
28 if (!data.value.content || !data.value.content.text) return
29 return h('div', {}, api.message.html.markdown(data.value.content))
30 }
31}
32

Built with git-ssb-web