-
Notifications
You must be signed in to change notification settings - Fork 29
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
Syntax highlighting of injected language not shown in Preview #7
Comments
This is a known limitation. The markdown preview uses highlight.js for highlighting, not VS Code's highlighting |
Closing this as this is current design of VS Code. microsoft/vscode#56356 would let the preview use VS Code's built-in highlighter instead |
For those finding this in the future, the mermaid markdown example also by @mjbvz shows where to plug in custom syntax highlighting in markdown preview. And vscode-textmate can be used to adapt tokens to hljs class names. It would be nice if vscode did this automatically, but it's possible to wire up manually at this point. |
Thanks @tjpalmer |
Thanks @mjbvz for this super helpful example.
Running the example as it is I get the following behavior:
It seems within the md.-file the injected Syntax is highlighted but in the Preview, it isn't. Is that by design? Is it possible to transfer the Syntax highlighting functionality into the Preview as well?
My Setup:
Version: 1.46.1
Electron: 7.3.1
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 5.3.0-61-generic
The text was updated successfully, but these errors were encountered: