aboutsummaryrefslogtreecommitdiff
path: root/lib/render.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/render.js')
-rw-r--r--lib/render.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/render.js b/lib/render.js
index bf61a43..7593e41 100644
--- a/lib/render.js
+++ b/lib/render.js
@@ -40,15 +40,19 @@ MdRenderer.prototype.link = function (ref, title, text) {
var myName = this.render.app.getNameSync(ref)
if (myName) title = title ? title + ' (' + myName + ')' : myName
}
+ var hrefToken = href !== false ? u.token() : undefined
var a = h('a', {
class: href === false ? 'bad' : undefined,
- href: href !== false ? href : undefined,
+ href: href !== false ? hrefToken : undefined,
title: title || undefined,
download: name ? encodeURIComponent(name) : undefined
})
// text is already html-escaped
a.innerHTML = text
- return a.outerHTML
+ var html = a.outerHTML
+ // href is already html-escaped
+ if (hrefToken) html = html.replace(hrefToken, href)
+ return html
}
MdRenderer.prototype.mention = function (preceding, id) {