-
Notifications
You must be signed in to change notification settings - Fork 91
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
Support Multiple PreConfig for different languages #114
Comments
Hi @huntrist , you can use the
or custom your own Because the content in CodeBlock cannot be determined currently, it may be pure text, a particular programming language, or a mixture of multiple languages. Therefore, I believe that in order to achieve such functionality, it needs to be determined by the user themselves. |
thanks, this could work, but I still think making it accept multiple PreConfig for different languages, and detect language marking by the MarkdownWidget is a cleaner approach. I believe it is a common practice specifying language with a "language marking" (called "info string" in the CommonMark spec: see text right after example-141: https://spec.commonmark.org/0.30/#example-141) i.e. ``` javascript if we let user specify multiple PreConfig for different languages, and MarkdownWidget can automatically detects the "language name marking" (javascript in this case), then the highlights can be applied accordingly. If no matching PreConfig for the language marking is found (or if no language marking is given), then apply the default PreConfig. |
Hi @huntrist , that's a good idea, I will consider how to implement this feature in the upcoming version. |
Is your feature request related to a problem? Please describe.
Currently, only support 1 PreConfig, but sometimes, there might be multiple code blocks of DIFFERENT languages, and the language used might not be known before the markdown text is rendered.
Describe the solution you'd like
Please consider support multiple PreConfig: let user define ALL the languages they want to be supported, and MarkdownWidget chooses the correct one based on the Language marking in the markdown
Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: