Commit c3d96d538721cc63ce7226a5ccf0bf754ec5054e
Render links to ssb-blob:// zip files
cel committed on 12/31/2017, 2:55:40 AMParent: bcb25299e3ad4af71de348fa62dc6027b80cdc12
Files changed
lib/render-msg.js | changed |
lib/render.js | changed |
lib/render-msg.js | ||
---|---|---|
@@ -799,8 +799,9 @@ | ||
799 | 799 … | return el |
800 | 800 … | case 'string': |
801 | 801 … | if (val[0] === '#') return cb(null, h('a', {href: self.toUrl('/channel/' + val.substr(1))}, val)) |
802 | 802 … | if (u.isRef(val)) return self.link1(val, cb) |
803 … | + if (/^ssb-blob:\/\//.test(val)) return cb(), h('a', {href: self.toUrl(val)}, val) | |
803 | 804 … | return cb(), self.linkify(val) |
804 | 805 … | case 'boolean': |
805 | 806 … | return cb(), h('input', { |
806 | 807 … | type: 'checkbox', disabled: 'disabled', checked: val |
lib/render.js | ||
---|---|---|
@@ -185,8 +185,11 @@ | ||
185 | 185 … | if (!href) return href |
186 | 186 … | var mentions = this._mentions |
187 | 187 … | if (mentions && href in this._mentions) href = this._mentions[href] |
188 | 188 … | if (/^ssb:\/\//.test(href)) href = href.substr(6) |
189 … | + if (/^ssb-blob:\/\//.test(href)) { | |
190 … | + return this.opts.base + 'zip/' + href.substr(11) | |
191 … | + } | |
189 | 192 … | switch (href[0]) { |
190 | 193 … | case '%': |
191 | 194 … | if (!u.isRef(href)) return false |
192 | 195 … | return this.opts.base + |
Built with git-ssb-web