sergioramos / remark-prism

Syntax highlighter for markdown code blocks using Prism
95 stars 21 forks source link

How do I add a new language to prism? #223

Open husk-9 opened 3 years ago

husk-9 commented 3 years ago

On the docs for prism, it says you can extend prism by adding your own language definition: https://prismjs.com/extending.html

How would I add this to this remark plugin? Am I supposed to input it into the options?

lancejpollard commented 1 year ago

Same here, I looked through the remark-prism code, and didn't find any way to hook into adding a custom language :(

@sergioramos do you know if this could be added in a straightforward way?

lancejpollard commented 1 year ago

Actually I'm doing this in Next.js, but still not doing anything:

remarkPlugins: [
      [remarkPrism, { plugins: [path.resolve('./prism.plugin.custom-lang')] }],
      [remarkMath],
      [remarkGfm],
    ],