A WordPress plugin for creating Gutenberg blocks for displaying syntax highlighted snippets to blog posts
Warning: This is an experimental plugin which is probably insecure. Use at your own risk!
The Gutenberg plugin must be installed and active in order for this plugin to operate.
Upon activation a new block called Code snippet will appear in the list of blocks available.
Click on this block and start writing code!
To change the language used (default is css) open the block inspector (on the right-hand side of the Gutenberg editor). From there you can change the language.
You can choose to show or hide line numbers in the controls that appear above the block when it has focus.
For some reason when editing a page with multiple code snippet blocks changing the language or line number settings changes the wrong editor. However upon saving and updating the correct settings should show. Does not affect the front end.
Credit should go to Zac Gordon, whose guide at https://gutenberg.courses/development/ forms the basis of this plugin. Any mistakes are probably mine and not his!