git ssb

0+

Daan Patchwork / ssb-viewer



forked from cel / ssb-viewer

Commit 9357a5e729bcc1b6addd132bf1c7a860b13364d5

URL-encode in href: msg ids, not feed or blob ids

cel committed on 8/23/2018, 9:28:13 PM
Parent: afabd2eacb34221e1b60ed77cce59a621e8c8022

Files changed

render.jschanged
render.jsView
@@ -33,11 +33,11 @@
3333 case "%":
3434 return this.opts.msg_base + encodeURIComponent(href);
3535 case "@":
3636 href = (this.opts.mentions && this.opts.mentions[href.substr(1)]) || href;
37- return this.opts.feed_base + encodeURIComponent(href);
37+ return this.opts.feed_base + href;
3838 case "&":
39- return this.opts.blob_base + encodeURIComponent(href);
39+ return this.opts.blob_base + href;
4040 }
4141 if (href.indexOf("javascript:") === 0) return false;
4242 return href;
4343 };
@@ -440,17 +440,17 @@
440440 if (typeof c.vote.linkedText != "undefined")
441441 linkedText = c.vote.linkedText.substring(0, 75);
442442 return h('span.status',
443443 ['Liked ',
444- h('a', { href: base + c.vote.link }, linkedText),
444+ h('a', { href: base + encodeURIComponent(c.vote.link) }, linkedText),
445445 channel]);
446446 } else if (c.type == "vote") {
447447 var linkedText = "this";
448448 if (typeof c.vote.linkedText != "undefined")
449449 linkedText = c.vote.linkedText.substring(0, 75);
450450 return h('span.status',
451451 ['Voted ',
452- h('a', { href: base + c.vote.link }, linkedText)]);
452+ h('a', { href: base + encodeURIComponent(c.vote.link) }, linkedText)]);
453453 } else if (c.type == "contact" && c.following) {
454454 var name = c.contact;
455455 if (typeof c.contactAbout != "undefined")
456456 name = c.contactAbout.name;

Built with git-ssb-web