marp-team / marp-core

The core of Marp converter
MIT License
750 stars 127 forks source link

`highlightjs` getter #350

Closed yhatt closed 11 months ago

yhatt commented 1 year ago

Expose highlight.js instance through get highlightjs() getter to make languages easy extensible.

// engine.js for Marp CLI
import highlightjsHLSL from 'highlightjs-hlsl'

export default ({ marp }) => {
  marp.highlightjs.registerLanguage('hlsl', highlightjsHLSL)
  return marp
})

And now Marp Core generates an independent highlight.js instances per Marp Core instances. It's important for the app using Marp Core, to avoid share the instance between highlight.js for Marp and the highlight.js for other purpose.