Bespoke with Marp Core #57
-
Hi, I looked at the Bespoke template in the CLI repository, but it looks like adding Bespoke is not trivial. I tried to inject the extra Thanks for your working on Marp and taking the time to help with this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It looks like the problem of your code rather than Marp's problem. The simplest way is just to concatenate the output string and stringified extra scripts. Taking this will NEVER escape characters because there is no processing to both scripts. const script = 'alert("your bespoke code")'
const { css, html } = marp.render(markdown)
const output = `
<style>${css}</style>
${html}
<script>${script}</script>
` |
Beta Was this translation helpful? Give feedback.
It looks like the problem of your code rather than Marp's problem.
The simplest way is just to concatenate the output string and stringified extra scripts. Taking this will NEVER escape characters because there is no processing to both scripts.