Why Prismjs is not highlighting the syntax?

I completed the markdown previewer challenge using React. I used markedjs for markdown compiling and for highlighting I used prismjs.

Codepen link: https://codepen.io/nimanthadilz/pen/wvdXGbJ?editors=0011

In the preview codeblock doesn’t have syntax highlighting as expected. When I inspect the code block I can see the span elements with different classnames like “token”, “keyword”, “punctuation”. (I think these elements are added by the prismjs) But why the syntax highlighting is not working ?

Please help me to solve this.
Thank you.

You are missing the CSS file, check the docs.

Base styles: https://unpkg.com/prismjs@1.24.1/themes/prism.css

1 Like

Thank you very much @lasjorg. I should have read the docs thoroughly.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.