Skip to content

Instantly share code, notes, and snippets.

@sebastiandedeyne
Created March 28, 2018 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebastiandedeyne/60dea6513b5d7a553525715fb5fe4368 to your computer and use it in GitHub Desktop.
Save sebastiandedeyne/60dea6513b5d7a553525715fb5fe4368 to your computer and use it in GitHub Desktop.
const marked = require("marked");
const loaderUtils = require("loader-utils");
module.exports = function(source) {
const { template } = loaderUtils.getOptions(this);
return `
import Template from '${template}'
export default () =>
<Template>
<div dangerouslySetInnerHTML={{ __html: ${JSON.stringify(
marked(source)
)} }}/>
</Template>
`;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment