Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

highlightjs getter #350

Merged
merged 7 commits into from
Aug 1, 2023
Merged

highlightjs getter #350

merged 7 commits into from
Aug 1, 2023

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Jul 11, 2023

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.

@yhatt yhatt merged commit 0fc5ad8 into main Aug 1, 2023
1 check passed
@yhatt yhatt deleted the refactor-lazy-highlightjs branch August 1, 2023 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant