const {outdent} = require('outdent'); const markdownLib = require('../../plugins/markdown'); // this is not working yet const insertion = (img, figcaption, alt, children) => { if (!img) { throw new Error(`Must have an image-path.`); } if (!alt) { throw new Error('Images must have an alt text.'); } if (!figcaption) { throw new Error('Must have a figcaption'); } if (!children) { throw new Error('add a content.'); } const content = markdownLib.render(children.trim()); return outdent`