aboutsummaryrefslogtreecommitdiff
path: root/lib/render.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/render.js')
-rw-r--r--lib/render.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/render.js b/lib/render.js
index 055d3d2..ec62b31 100644
--- a/lib/render.js
+++ b/lib/render.js
@@ -66,7 +66,7 @@ MdRenderer.prototype.link = function (ref, title, text) {
var link = this.render._mentionsByLink[ref]
if (link && link.type === 'text/x-markdown') {
html += h('sup', ' [', h('a', {
- href: this.render.toUrl('/markdown/' + encodeURIComponent(ref)),
+ href: this.render.toUrl('/markdown/' + ref),
title: 'view rendered markdown'
}, 'md'), ']').outerHTML
}
@@ -86,7 +86,7 @@ MdRenderer.prototype.mention = function (preceding, id) {
var link = this.render._mentionsByLink[id]
if (link && link.type === 'text/x-markdown') {
html += h('sup', ' [', h('a', {
- href: this.render.toUrl('/markdown/' + encodeURIComponent(id)),
+ href: this.render.toUrl('/markdown/' + id),
title: 'view rendered markdown'
}, 'md'), ']').outerHTML
}
@@ -179,7 +179,10 @@ Render.prototype.markdown = function (text, mentions) {
else if (link.host === 'http://localhost:7777')
mentionsObj[link.href] = link.link
if (link.link)
- mentionsByLink[link.link + (link.key ? '#' + link.key : '')] = link
+ mentionsByLink[link.link +
+ (link.query && typeof link.query.unbox === 'string' ?
+ '?unbox=' + link.query.unbox.replace(/\s/g, '+') : '') +
+ (link.key ? '#' + link.key : '')] = link
})
var out = marked(String(text), this.markedOpts)
delete this._mentions