marp-team / marp-cli

A CLI interface for Marp and Marpit based converters
MIT License
1.9k stars 108 forks source link

`--engine ./engine.js` doesn't render code blocks well #168

Closed exKAZUu closed 5 years ago

exKAZUu commented 5 years ago

I have the following files.

When I use --engine @marp-team/marp-core, it works well. Interestingly, when I use --engine ./engine.js, it doesn't render the code block well as follows.

image

exKAZUu commented 5 years ago

I upload the generated html file as .txt file here.

sample.html.txt

yhatt commented 5 years ago

Thanks for feedback. Perhaps it's not triggered Marp.ready() on the browser context.

Marp Core package has defined path to JS for bundling with HTML, but it's cannot in functional engine. We should consider a way to add browser script by custom engine.

As a workaround, load Marp Core's browser script manually in Markdown. (require --html option)

# Your contents

...

<script defer src="https://cdn.jsdelivr.net/npm/@marp-team/marp-core/lib/browser.js"></script>
exKAZUu commented 5 years ago

Thank you for your quick response. I confirm the workaround solves this issue!