aboutsummaryrefslogtreecommitdiff
path: root/lib/render.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/render.js')
-rw-r--r--lib/render.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/render.js b/lib/render.js
index 0d83f75..e9fae80 100644
--- a/lib/render.js
+++ b/lib/render.js
@@ -25,12 +25,22 @@ MdRenderer.prototype.urltransform = function (href) {
}
MdRenderer.prototype.image = function (ref, title, text) {
- var href = this.render.imageUrl(ref)
- return h('img', {
- src: href,
- alt: this.render.getImageAlt(ref, text),
+ var alt = this.render.getImageAlt(ref, text)
+ return (/^video:/.test(text) ? h('video', {
+ controls: 'controls',
+ src: this.render.toUrl(ref),
+ alt: alt,
title: title || undefined
- }).outerHTML
+ }) : /^audio:/.test(text) ? h('audio', {
+ controls: 'controls',
+ src: this.render.toUrl(ref),
+ alt: alt,
+ title: title || undefined
+ }) : h('img', {
+ src: this.render.imageUrl(ref),
+ alt: alt,
+ title: title || undefined
+ })).outerHTML
}
MdRenderer.prototype.link = function (ref, title, text) {