From 36dd4c128fa2b5b789542cb0a3f2b16231980fb4 Mon Sep 17 00:00:00 2001 From: cel Date: Tue, 16 May 2017 08:11:28 -1000 Subject: Use hyperscript to generate markdown link html --- lib/render.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/render.js b/lib/render.js index 1cd92e6..74b4f4f 100644 --- a/lib/render.js +++ b/lib/render.js @@ -37,13 +37,12 @@ MdRenderer.prototype.image = function (ref, title, text) { MdRenderer.prototype.link = function(href, title, text) { href = this.urltransform(href) var name = href && /^\/(&|%26)/.test(href) && (title || text) - return '' + text + '' + return h('a', { + class: href === false ? 'bad' : undefined, + href: href !== false ? href : undefined, + title: title || undefined, + download: name ? encodeURIComponent(name) : undefined + }, text).outerHTML }; -- cgit v1.2.3