Support audio and video elements

This commit is contained in:
cel
2020-09-10 02:31:58 +00:00
parent aa1697181e
commit 38c61a5069
+12
View File
@@ -55,6 +55,18 @@ MdRenderer.prototype.image = function(href, title, text) {
{ type: 'image/svg+xml',
data: href,
alt: text }).outerHTML
else if (/^video:/.test(text))
return h('video', {
controls: 'controls',
src: this.opts.blob_base + href,
title: title || undefined
}).outerHTML
else if (/^audio:/.test(text))
return h('audio', {
controls: 'controls',
src: this.opts.blob_base + href,
title: title || undefined
}).outerHTML
else
return h('img',
{ src: this.opts.img_base + href,