React-markdown: can not highlight code block

Created on 29 Oct 2018  Â·  3Comments  Â·  Source: remarkjs/react-markdown

code:
image

result:
image

Expect:
image

invalid 🙅

Most helpful comment

@rexxars I ran into this issue too, I think what contributes to the confusion is that the demo site shows syntax highlighting. It might be a good idea to add a line to the docs or to the demo site explaining that syntax highlighting doesn't come by default.

All 3 comments

Syntax highlighting is not a part of react-markdown.
You can override the code renderer with something like react-refractor or react-lowlight to achieve the result you desire.

@rexxars I ran into this issue too, I think what contributes to the confusion is that the demo site shows syntax highlighting. It might be a good idea to add a line to the docs or to the demo site explaining that syntax highlighting doesn't come by default.

Here's a good resource for those looking on how to add syntax highlighting.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Yunnkii picture Yunnkii  Â·  3Comments

guilhermecastro-hotmart picture guilhermecastro-hotmart  Â·  3Comments

neilyoung picture neilyoung  Â·  3Comments

dekryptic picture dekryptic  Â·  3Comments

kennetpostigo picture kennetpostigo  Â·  4Comments