Bug: Unable to add additional language if Prism is used outside lexical editor
Hi, thank you for all the work on this plugins, it is awesome!
I tried create a site that will show some highlighted code and then an editor box somewhere below.
As the code language (dockerfile for example) is imported in @lexical/code, so I tried to import it.
Then I notice that I can't select the new imported language as code language.
In debugger, I found that:
- In
mapToPrismLanguage(),Prism.languagedo not have docker property, even though it was imported somewhere. - lexical has its own Prism object (no docker in languages property) in its closure, while there is another Prism object in global closure (with docker property).
Is it possible to inject new language to lexical's closure or lexical should use the global one after all?
Let me know if anything is confusing or more info is needed.
Lexical version: 0.7.6
Steps To Reproduce
Requirement: The language is not a the default imported language. (e.g, docker)
- Use prism in other file, for example create a code block with such language and highlight it
- Create a code block in lexical, and select the new language as highlight language (docker)
Link to code example: https://codesandbox.io/s/fast-cdn-0uo6kh
The current behavior
Unable to select the new imported language
The expected behavior
- Able to select the new imported language
- Correctly highlight the syntax