Within my short blogging time, I recognized that I mostly write about ServiceNow stuff right now. This somehow requires posting code from widgets or scripts into the blog post so that you can easier follow my solution. Within all these posts I used the default WordPress Gutenberg [code] Block, but I somehow was never satisfied with it.
Missing options with the default code block
I missed a couple of options in the code block to show the code nice and clean. To me the following issues were the reason to look for something else:
- No line numbers
- Just plain code without code syntax highlighting
- No copy option for readers
The solution – Plugin: CodeMirror Block
To find a potential solution I searched the huge WordPress plugin community and was able to quickly identify a plugin that will help me with all three issues I had. The plugin is named CodeMirror Block and does exactly what I expect. You can even change the language of the code block to display e.g. JavaScript, CSS, HTML, and a lot of other programming languages.
How do you like that solution?