-
Hi! I'm trying to understand the following: I can export as html a slide containing an image given as inline base64 data, If I manually insert the svg base64 data in an Any ideas? Thanks! /K |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Marp is using markdown-it as a Markdown parser, and unfortunately markdown-it does not have a support for SVG data image URI. And the author of markdown-it is opposed to changing this restriction.
If you want to render SVG data URI image in Marp, you have to use a raw // engine.js for Marp CLI
module.exports = ({ marp }) => marp.use((md) => {
// https://github.com/markdown-it/markdown-it/issues/447#issuecomment-373408654
const defaultValidateLink = md.validateLink;
md.validateLink = url => /^data:image\/.*?;/.test(url) || defaultValidateLink(url);
})
|
Beta Was this translation helpful? Give feedback.
Marp is using markdown-it as a Markdown parser, and unfortunately markdown-it does not have a support for SVG data image URI. And the author of markdown-it is opposed to changing this restriction.
If you want to render SVG data URI image in Marp, you have to use a raw
<img>
tag with enabling HTML, or use a plugin to allow SVG data URI as a recognizable URL (only in Marp CLI).