Commit 36dd4c128fa2b5b789542cb0a3f2b16231980fb4
Use hyperscript to generate markdown link html
cel committed on 5/16/2017, 6:11:41 PMParent: f8b516671c8a45fb1453fd20d42d692f8040d7a5
Files changed
lib/render.js | changed |
lib/render.js | ||
---|---|---|
@@ -36,15 +36,14 @@ | ||
36 | 36 … | |
37 | 37 … | MdRenderer.prototype.link = function(href, title, text) { |
38 | 38 … | href = this.urltransform(href) |
39 | 39 … | var name = href && /^\/(&|%26)/.test(href) && (title || text) |
40 | - return '<a' | |
41 | - + (href !== false | |
42 | - ? ' href="' + href + '"' | |
43 | - : ' class="bad"') | |
44 | - + (title ? ' title="' + title + '"' : '') | |
45 | - + (name ? ' download="' + encodeURIComponent(name) + '"' : '') | |
46 | - + '>' + text + '</a>' | |
40 … | + return h('a', { | |
41 … | + class: href === false ? 'bad' : undefined, | |
42 … | + href: href !== false ? href : undefined, | |
43 … | + title: title || undefined, | |
44 … | + download: name ? encodeURIComponent(name) : undefined | |
45 … | + }, text).outerHTML | |
47 | 46 … | }; |
48 | 47 … | |
49 | 48 … | |
50 | 49 … | function lexerRenderEmoji(emoji) { |
Built with git-ssb-web