git ssb

16+

cel / patchfoo



Commit c3d96d538721cc63ce7226a5ccf0bf754ec5054e

Render links to ssb-blob:// zip files

cel committed on 12/31/2017, 2:55:40 AM
Parent: bcb25299e3ad4af71de348fa62dc6027b80cdc12

Files changed

lib/render-msg.jschanged
lib/render.jschanged
lib/render-msg.jsView
@@ -799,8 +799,9 @@
799799 return el
800800 case 'string':
801801 if (val[0] === '#') return cb(null, h('a', {href: self.toUrl('/channel/' + val.substr(1))}, val))
802802 if (u.isRef(val)) return self.link1(val, cb)
803 + if (/^ssb-blob:\/\//.test(val)) return cb(), h('a', {href: self.toUrl(val)}, val)
803804 return cb(), self.linkify(val)
804805 case 'boolean':
805806 return cb(), h('input', {
806807 type: 'checkbox', disabled: 'disabled', checked: val
lib/render.jsView
@@ -185,8 +185,11 @@
185185 if (!href) return href
186186 var mentions = this._mentions
187187 if (mentions && href in this._mentions) href = this._mentions[href]
188188 if (/^ssb:\/\//.test(href)) href = href.substr(6)
189 + if (/^ssb-blob:\/\//.test(href)) {
190 + return this.opts.base + 'zip/' + href.substr(11)
191 + }
189192 switch (href[0]) {
190193 case '%':
191194 if (!u.isRef(href)) return false
192195 return this.opts.base +

Built with git-ssb-web