Jarvis1010 / react-copy-code

A React component to add copy to clipboard funcitonality to 'pre code' blocks
MIT License
9 stars 4 forks source link

How to add highlight js class name #7

Closed tufail closed 4 years ago

tufail commented 4 years ago

Please help me with the className ="html" for highlight.js

here is my code ` <CodeBlock style={{ overflow: "scroll" }} highlight={true}>

                        {JSON.stringify(top100Films, null, 4)}
                      
                </CodeBlock>`

this is not working just showing the plan text with auto class names

tufail commented 4 years ago

Got it . imported the style file and working .. thank you for this plugin. import "highlight.js/styles/darkula.css"; styles from this below git repo https://github.com/highlightjs/highlight.js/tree/master/src/styles