Commit 0131ecbd3cc024a9049c5dab91ce05c70613dcd5
support image embeds
Dominic Tarr committed on 5/12/2016, 9:33:19 AMParent: 96d0a60a7b7c41087f0c52c4ed0292f86ba7d4b1
Files changed
modules/post.js | changed |
package.json | changed |
modules/post.js | ||
---|---|---|
@@ -1,7 +1,9 @@ | ||
1 | 1 | var markdown = require('ssb-markdown') |
2 | 2 | var h = require('hyperscript') |
3 | 3 | var u = require('../util') |
4 | +var ref = require('ssb-ref') | |
5 | + | |
4 | 6 | //render a message |
5 | 7 | |
6 | 8 | exports.message_content = function (data, sbot) { |
7 | 9 | if(!data.value.content || !data.value.content.text) return |
@@ -21,8 +23,10 @@ | ||
21 | 23 | }) |
22 | 24 | |
23 | 25 | content.innerHTML = |
24 | 26 | markdown.block(data.value.content.text, {toUrl: function (id) { |
27 | + if(ref.isBlob(id)) | |
28 | + return 'http://localhost:7777/'+encodeURIComponent(id) | |
25 | 29 | return '#'+(mentions[id]?mentions[id]:id) |
26 | 30 | }}) |
27 | 31 | return d |
28 | 32 | } |
package.json | ||
---|---|---|
@@ -9,10 +9,13 @@ | ||
9 | 9 | }, |
10 | 10 | "dependencies": { |
11 | 11 | "depject": "0.0.2", |
12 | 12 | "hyperscript": "^1.4.7", |
13 | + "hypertabs": "^0.1.0", | |
13 | 14 | "moment": "^2.13.0", |
15 | + "pull-cat": "^1.1.9", | |
14 | 16 | "pull-paramap": "^1.1.6", |
17 | + "pull-sort": "^1.0.0", | |
15 | 18 | "pull-stream": "^3.3.2", |
16 | 19 | "ssb-client": "^3.0.1", |
17 | 20 | "ssb-markdown": "^3.0.0" |
18 | 21 | }, |
Built with git-ssb-web