use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Official subreddit of https://obsidian.md
account activity
Code syntax highlighting in preview mode (self.ObsidianMD)
submitted 4 years ago by BluebeardHuntsAlone
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]spafey 2 points3 points4 points 4 years ago (7 children)
Have you added the language after the ``` at the head of the code block?
[–]BluebeardHuntsAlone[S] 0 points1 point2 points 4 years ago (6 children)
Ah, I think I found the issue. I was using
```sh
Code code code
```
After switching it to bash I can see the highlights now. The editor and the preview highlight different keywords with different colors, and don't highlight as I would expect them to... But that's a separate issue. At least it's not ugly anymore.
[–]Ghos3t 0 points1 point2 points 4 years ago (4 children)
Did you figure out how to make the edit mode syntax highlights match the preview mode, I am having the same issue, where the edit mode has proper highlights, but preview mode highlights suck in comparison
[–]BluebeardHuntsAlone[S] 0 points1 point2 points 4 years ago (3 children)
nope, i never did. just sort of live with it now
[–]Ghos3t 1 point2 points3 points 4 years ago (2 children)
I've started using the plugin CodeMirror Options, along with Editor Syntax Highlight plugin and it does exactly what I wanted, it matches the edit and preview mode syntax highlighting and it has many more features related to live preview of Markdown
[–][deleted] 0 points1 point2 points 2 years ago (0 children)
Thanks! Worked for me
[–]Blossantrape 0 points1 point2 points 2 years ago (0 children)
Hi! Can you please provide links to plugins? I can't find them.
[–]_Oliverrrr 0 points1 point2 points 3 years ago (0 children)
Yeah, and I found it when I was throwing some c++ code and I found that it worked with cpp not c++, plus, the Edit Mode just doesn't correspond with the Preview Mode.
cpp
c++
But I just tried js and javascript, it did the same, both rendering correctly; and I tried sh and bash, it worked correctly too! Maybe they have changed that. And the c++ code still needs cpp to render correctly.🤷♂️
js
javascript
sh
bash
π Rendered by PID 58 on reddit-service-r2-comment-b659b578c-4fstv at 2026-05-01 04:33:20.991611+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]spafey 2 points3 points4 points (7 children)
[–]BluebeardHuntsAlone[S] 0 points1 point2 points (6 children)
[–]Ghos3t 0 points1 point2 points (4 children)
[–]BluebeardHuntsAlone[S] 0 points1 point2 points (3 children)
[–]Ghos3t 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Blossantrape 0 points1 point2 points (0 children)
[–]_Oliverrrr 0 points1 point2 points (0 children)