diff options
Diffstat (limited to 'lib/render.js')
-rw-r--r-- | lib/render.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/render.js b/lib/render.js index 7e24d29..cde359d 100644 --- a/lib/render.js +++ b/lib/render.js @@ -106,11 +106,15 @@ Render.prototype.toUrl = function (href) { if (mentions && href in this._mentions) href = this._mentions[href] if (/^ssb:\/\//.test(href)) href = href.substr(6) switch (href[0]) { - case '%': return this.opts.base + encodeURIComponent(href) + case '%': + if (!u.isRef(href)) return false + return this.opts.base + encodeURIComponent(href) case '@': if (!u.isRef(href)) return false return this.opts.base + href - case '&': return this.opts.blob_base + href + case '&': + if (!u.isRef(href)) return false + return this.opts.blob_base + href case '#': return this.opts.base + encodeURIComponent(href) case '/': return this.opts.base + href.substr(1) case '?': return this.opts.base + 'search?q=' + encodeURIComponent(href) |