Commit 2c9debe895029d2020d827bbb60f3d96115d2e8d
markdown
Joran committed on 11/11/2017, 6:18:47 AMParent: 8f6cde9a147df8d5000afd84a4653031fe7f06ee
Files changed
package-lock.json | changed |
src/components/Message.vue | changed |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 370916 bytes New file size: 370896 bytes |
src/components/Message.vue | ||
---|---|---|
@@ -3,10 +3,12 @@ | ||
3 | 3 … | <div class="media"> |
4 | 4 … | <img class="d-flex mr-3" :alt="author"> |
5 | 5 … | <div class="media-body"> |
6 | 6 … | <h5 class="mt-0">{{ author }}</h5> |
7 | - {{ message.value.content.text() }} | |
8 | 7 … | |
8 … | + <span v-html="content_text()"></span> | |
9 … | + | |
10 … | + | |
9 | 11 … | <p> |
10 | 12 … | {{ message.value.content.type() }} |
11 | 13 … | </p> |
12 | 14 … | </div> |
@@ -17,9 +19,10 @@ | ||
17 | 19 … | |
18 | 20 … | // var pull = require('pull-stream') |
19 | 21 … | import Rx from 'rxjs/RX' |
20 | 22 … | import { Observable } from 'rxjs/Observable' |
21 | -const nn = require('nevernull'); | |
23 … | +const nn = require('nevernull') | |
24 … | +const md = require('ssb-markdown') | |
22 | 25 … | |
23 | 26 … | export default { |
24 | 27 … | name: 'message', |
25 | 28 … | props: ['message'], |
@@ -30,12 +33,18 @@ | ||
30 | 33 … | }, |
31 | 34 … | methods: { |
32 | 35 … | setAuthor(err, a){ |
33 | 36 … | this.author = nn(a[0]).name() |
37 … | + }, | |
38 … | + content_text() | |
39 … | + { | |
40 … | + return md.block( this.message.value.content.text() ) | |
34 | 41 … | } |
35 | 42 … | }, |
36 | 43 … | created() { |
37 | - this.$depject_api.signifier[0](this.message.value.author(), this.setAuthor) | |
44 … | + this.$depject_api.signifier[0]( | |
45 … | + this.message.value.author(), this.setAuthor | |
46 … | + ) | |
38 | 47 … | } |
39 | 48 … | } |
40 | 49 … | |
41 | 50 … | </script> |
Built with git-ssb-web