condorheroblog / vuepress-plugin-export-pdf

VuePress plugin exports PDF 📁.
MIT License
23 stars 4 forks source link

Markdown-it plugins not being rendered to pdf #16

Closed aerialhedgehog closed 1 year ago

aerialhedgehog commented 1 year ago

in vuepress 2.0.0-beta.67, i am applying markdown-it plugins via the .vuepress/config.ts file. the plugins are rendering correctly on a dev site, but appear to not be applied while exporting pdf. best i can tell is that the hook isn't being called.

example config.ts:

import { defaultTheme } from 'vuepress'
import md_multitable from 'markdown-it-multimd-table'

export default {
  ...

  extendsMarkdown: (md) => {
    md.use(md_multitable),
  },

}
condorheroblog commented 1 year ago
export default defineUserConfig({

    plugins: [
        {
            name: "markdown-it-multimd-table",
            extendsMarkdown: (md) => {
                md.use(mdMultimdTable);
            },
        }
    ],

})

I can get the correct export

image

aerialhedgehog commented 1 year ago

oh interesting, thank you. this is now working for me.

side question if you don't mind filling this answer in for the next person that stumbles on this -- is this a normal thing for vuepress v2? to put the definition of extendsMarkdown inside the plugins configuration?

working from the example the v2 docs present, i would have never guessed to configure the markdownnit plugins this way https://v2.vuepress.vuejs.org/reference/plugin-api.html#extendsmarkdown

condorheroblog commented 1 year ago

I think that usage is correct.🤯

aerialhedgehog commented 1 year ago

understood, thank you