git ssb

0+

Daan Patchwork / ssb-viewer



forked from cel / ssb-viewer

Commit ccc712bad78a439c6287c829554052b9cd943a4b

render svg

Anders Rune Jensen committed on 7/7/2017, 8:27:14 PM
Parent: d6e3e6a468d96496d2bc2c9f4e092864723d88d2

Files changed

render.jschanged
render.jsView
@@ -40,13 +40,19 @@
4040 return href;
4141 };
4242
4343 MdRenderer.prototype.image = function(href, title, text) {
44- return h('img',
45- { src: this.opts.img_base + href,
46- alt: text,
47- title: title
48- }).outerHTML;
44+ if (text.endsWith(".svg"))
45+ return h('object',
46+ { type: 'image/svg+xml',
47+ data: href,
48+ alt: text }).outerHTML;
49+ else
50+ return h('img',
51+ { src: this.opts.img_base + href,
52+ alt: text,
53+ title: title
54+ }).outerHTML;
4955 };
5056
5157 function renderEmoji(emoji) {
5258 var opts = this.renderer.opts;

Built with git-ssb-web