I would like the code blocks in the preview pane of markdown files in VS Code to match the background and syntax highlighting of the code in my VS Code theme.
Is this possible in VS Code or does this require I make a new extension?
I have looked through the following resources and do not have a solid answer: VS Code Extensions, VS Code Markdown, VS Code Themes.
There's a github issue about it. They apparently don't care to change this, but there's a marketplace extension that does it. N.B. I haven't used it, but it's the one the contributor in the github thread suggested.
This was raised in Codeblocks in Markdown Preview don't use theme colors #84572. A maintainer (Matt Bierner) replied that the Markdown preview builtin to VS Code uses a different mechanism for syntax highlighting- highlight.js, and that this is (or at least was at the time of that writing) by-design, and that if one desires the highlighting to be closer matching, one should look for an extension that does that, such as potentially bierner.markdown-shiki
(an extension of theirs which I have no affiliation with, and which has its own limitations, such as this).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With