egoist / vmark

Convert markdown to Vue component.
MIT License
162 stars 11 forks source link

How to add markdown-it plugins? #10

Closed Julien76 closed 5 years ago

Julien76 commented 5 years ago

Hi,

I'm using vmark together with vmark-loader.

It works great but I can't find the way to add markdown-it modules to it. Is that possible?

For example, I want to use markdown-it-mermaid, normally I will use:

const md = new MarkdownIt().use(require('markdown-it-mermaid').default)

How should I do for vmark?

Thanks

egoist commented 5 years ago

I published a new version which adds the extend option: https://github.com/egoist/vmark#optionsextend

So you can now use markdown-it plugins like this:

const options = {
  extend(md) {
    md.use(require('markdown-it-plugin'))
  }
}