code-syntax-block
code-syntax-block copied to clipboard
Doesn't highlight in python
The highlighting doesn't work in Python (GB v4.0). Otherwise this looks really sweet!
Python is my primary use case for the plugin. I can confirm it is working for me on my post here: https://mkaz.blog/code/python-string-format-cookbook/
It would be great if you can try it again with the latest versions of Gutenberg and the plugin, and let me know if it works for you.
After adding a code block, you will need to select the language on the right, and the color does not show in the editor, only after published. See gif below for a quick example:
Closing, please reopen if the problem still exists.
Hi @mkaz, I've found the same problem with python, but it works on javascript as see in my gif

Thanks for helping :)
I've tested a lot about the Prism.js. I think it doesn't this plugin. This plugin just adds the additional class for code and pre (language-python), then when Prism has been loaded, it'll perform all matching class.
This snippet shows that it works! https://jsfiddle.net/mildronize/1wujfkLt/3/
I'll find out another solution to solve this one. (It may be my fault)
Thanks.
The problem is solved.
I need to add the python component of the Prism.js
For javascript es6,
import Prism from 'prismjs';
import 'prismjs/components/prism-python';
Prism.highlightAll();

Thank you for useful plugin.