Files: 88efa57edc6f7800ae827d2a28a7aab3065c1159 / message / html / subject.js
566 bytesRaw
1 | const nest = require('depnest') |
2 | const { h, when, send, resolve, Value, computed } = require('mutant') |
3 | const { title } = require('markdown-summary') |
4 | |
5 | |
6 | exports.gives = nest('message.html.subject') |
7 | |
8 | exports.needs = nest({ |
9 | 'message.html.markdown': 'first', |
10 | }) |
11 | |
12 | exports.create = function (api) { |
13 | return nest('message.html.subject', subject) |
14 | |
15 | function subject (msg) { |
16 | const { subject, text } = msg.value.content |
17 | if(!(subject || text)) return |
18 | |
19 | return subject |
20 | ? api.message.html.markdown(subject) |
21 | : api.message.html.markdown(title(text)) |
22 | } |
23 | } |
24 |
Built with git-ssb-web