URL-encode in href: msg ids, not feed or blob ids
This commit is contained in:
@@ -34,9 +34,9 @@ MdRenderer.prototype.urltransform = function(href) {
|
|||||||
return this.opts.msg_base + encodeURIComponent(href);
|
return this.opts.msg_base + encodeURIComponent(href);
|
||||||
case "@":
|
case "@":
|
||||||
href = (this.opts.mentions && this.opts.mentions[href.substr(1)]) || href;
|
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 "&":
|
case "&":
|
||||||
return this.opts.blob_base + encodeURIComponent(href);
|
return this.opts.blob_base + href;
|
||||||
}
|
}
|
||||||
if (href.indexOf("javascript:") === 0) return false;
|
if (href.indexOf("javascript:") === 0) return false;
|
||||||
return href;
|
return href;
|
||||||
@@ -441,7 +441,7 @@ function render(opts, id, c) {
|
|||||||
linkedText = c.vote.linkedText.substring(0, 75);
|
linkedText = c.vote.linkedText.substring(0, 75);
|
||||||
return h('span.status',
|
return h('span.status',
|
||||||
['Liked ',
|
['Liked ',
|
||||||
h('a', { href: base + c.vote.link }, linkedText),
|
h('a', { href: base + encodeURIComponent(c.vote.link) }, linkedText),
|
||||||
channel]);
|
channel]);
|
||||||
} else if (c.type == "vote") {
|
} else if (c.type == "vote") {
|
||||||
var linkedText = "this";
|
var linkedText = "this";
|
||||||
@@ -449,7 +449,7 @@ function render(opts, id, c) {
|
|||||||
linkedText = c.vote.linkedText.substring(0, 75);
|
linkedText = c.vote.linkedText.substring(0, 75);
|
||||||
return h('span.status',
|
return h('span.status',
|
||||||
['Voted ',
|
['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) {
|
} else if (c.type == "contact" && c.following) {
|
||||||
var name = c.contact;
|
var name = c.contact;
|
||||||
if (typeof c.contactAbout != "undefined")
|
if (typeof c.contactAbout != "undefined")
|
||||||
|
|||||||
Reference in New Issue
Block a user