From 9357a5e729bcc1b6addd132bf1c7a860b13364d5 Mon Sep 17 00:00:00 2001 From: cel Date: Thu, 23 Aug 2018 14:25:51 -0700 Subject: [PATCH] URL-encode in href: msg ids, not feed or blob ids --- render.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/render.js b/render.js index d5b2e21..13fe172 100644 --- a/render.js +++ b/render.js @@ -34,9 +34,9 @@ MdRenderer.prototype.urltransform = function(href) { return this.opts.msg_base + encodeURIComponent(href); case "@": href = (this.opts.mentions && this.opts.mentions[href.substr(1)]) || href; - return this.opts.feed_base + encodeURIComponent(href); + return this.opts.feed_base + href; case "&": - return this.opts.blob_base + encodeURIComponent(href); + return this.opts.blob_base + href; } if (href.indexOf("javascript:") === 0) return false; return href; @@ -441,7 +441,7 @@ function render(opts, id, c) { linkedText = c.vote.linkedText.substring(0, 75); return h('span.status', ['Liked ', - h('a', { href: base + c.vote.link }, linkedText), + h('a', { href: base + encodeURIComponent(c.vote.link) }, linkedText), channel]); } else if (c.type == "vote") { var linkedText = "this"; @@ -449,7 +449,7 @@ function render(opts, id, c) { linkedText = c.vote.linkedText.substring(0, 75); return h('span.status', ['Voted ', - h('a', { href: base + c.vote.link }, linkedText)]); + h('a', { href: base + encodeURIComponent(c.vote.link) }, linkedText)]); } else if (c.type == "contact" && c.following) { var name = c.contact; if (typeof c.contactAbout != "undefined")