aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-04-06 16:34:55 -0700
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-04-06 16:34:55 -0700
commit1f165c468822356b7379f04ae20447dcaf79d918 (patch)
treefba009de61a6941e71aa492394e7bcb4877a3fae /lib
parent22c9b2a241735a70f76473b4bb37fe530219e31c (diff)
downloadpatchfoo-1f165c468822356b7379f04ae20447dcaf79d918.tar.gz
patchfoo-1f165c468822356b7379f04ae20447dcaf79d918.zip
Use download property instead of link name field
Diffstat (limited to 'lib')
-rw-r--r--lib/render.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/render.js b/lib/render.js
index 9c37d9c..3a39ccb 100644
--- a/lib/render.js
+++ b/lib/render.js
@@ -37,12 +37,12 @@ MdRenderer.prototype.image = function (href, title, text) {
MdRenderer.prototype.link = function(href, title, text) {
href = this.urltransform(href)
var name = href && /^\/(&|%26)/.test(href) && (title || text)
- if (name) href += '?name=' + encodeURIComponent(name)
return '<a'
+ (href !== false
? ' href="' + href + '"'
: ' class="bad"')
+ (title ? ' title="' + title + '"' : '')
+ + (name ? ' download="' + encodeURIComponent(name) + '"' : '')
+ '>' + text + '</a>'
};