Thanks for the above tut. It's easy to follow. Sadly, I can't get line numbers working. I think it's an issue with the babel plugin. I get the following error:
"Unhandled Rejection (TypeError): Prism.util.isActive is not a function"
I have the latest prism and babel plugin installed in my CRA, but no luck. Any ideas? Could you update your example with working line-numbers? Thanks!
I was also unable to make it work with the babel-plugin-prismjs but here is how i managed to do it.
Since the plugins come with the prismjs package, you just need to ;
Import the css file of the plugin from "prismjs/plugins/{plugin-folder}/{plugin.css}" using the import statement.
you need to add the babel-plugin-prismjs plugin and configure the .babelrc file
you can read more on github
github.com/mAAdhaTTah/babel-plugin...
my .babelrc file looks like this:
Thanks for the above tut. It's easy to follow. Sadly, I can't get line numbers working. I think it's an issue with the babel plugin. I get the following error:
"Unhandled Rejection (TypeError): Prism.util.isActive is not a function"
I have the latest prism and babel plugin installed in my CRA, but no luck. Any ideas? Could you update your example with working line-numbers? Thanks!
I was also unable to make it work with the babel-plugin-prismjs but here is how i managed to do it.
Since the plugins come with the prismjs package, you just need to ;
from "prismjs/plugins/{plugin-folder}/{plugin.css}"
using theimport
statement.<pre>
tag.for more info check out prismjs/plugins.
Edit.
You also need to import the js file of the plugin as well.
more from here