Closed phuchptty closed 1 year ago
Prismjs will create a Prism
instance globally, which can be configurable directly through this method.
import Prism from 'prismjs';
Prism.plugins.autoloader.languages_path = 'path/to/grammars/';
If you are running in a browser, you could be able to get the instance from window.Prism
after require('prismjs')
.
Is your feature request related to a problem? Please describe. Yes. I met a problem when using Autoloader plugin. Because there's no option to config plugin so I can't access to Prism's instance and add languages_path to autoloader.
Prism.plugins.autoloader.languages_path = 'path/to/grammars/';
Describe the solution you'd like Export or allow custom Prism instance.
Additional context Prism's autoloader: https://prismjs.com/plugins/autoloader/