render svg

This commit is contained in:
Anders Rune Jensen
2017-07-07 22:27:14 +02:00
parent d6e3e6a468
commit ccc712bad7
+6
View File
@@ -41,6 +41,12 @@ MdRenderer.prototype.urltransform = function(href) {
}; };
MdRenderer.prototype.image = function(href, title, text) { MdRenderer.prototype.image = function(href, title, text) {
if (text.endsWith(".svg"))
return h('object',
{ type: 'image/svg+xml',
data: href,
alt: text }).outerHTML;
else
return h('img', return h('img',
{ src: this.opts.img_base + href, { src: this.opts.img_base + href,
alt: text, alt: text,