git ssb

16+

cel / patchfoo



Commit 36dd4c128fa2b5b789542cb0a3f2b16231980fb4

Use hyperscript to generate markdown link html

cel committed on 5/16/2017, 6:11:41 PM
Parent: f8b516671c8a45fb1453fd20d42d692f8040d7a5

Files changed

lib/render.jschanged
lib/render.jsView
@@ -36,15 +36,14 @@
3636
3737 MdRenderer.prototype.link = function(href, title, text) {
3838 href = this.urltransform(href)
3939 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
4746 };
4847
4948
5049 function lexerRenderEmoji(emoji) {

Built with git-ssb-web