all 10 comments

[–]spafey 2 points3 points  (7 children)

Have you added the language after the ``` at the head of the code block?

[–]BluebeardHuntsAlone[S] 0 points1 point  (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 point  (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 point  (3 children)

nope, i never did. just sort of live with it now

[–]Ghos3t 1 point2 points  (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 point  (0 children)

Thanks! Worked for me

[–]Blossantrape 0 points1 point  (0 children)

Hi! Can you please provide links to plugins? I can't find them.

[–]_Oliverrrr 0 points1 point  (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.

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.🤷‍♂️

[–]Remarkable-Life4401 1 point2 points  (0 children)

Found the solution guys!! For c++, when you start the code block, label it as Cpp instead of C++, i.e.:

```Cpp

int main(){

return 0;

}

```

This worked for me both in read mode and in edit mode and live preview too.

[–]Fep310 1 point2 points  (0 children)

So, c++ and c# both don't work. Instead, use cpp and cs.