Many times a good WordPress theme does not render code properly. There are problems like too big font making it harder to read the text. I use StackEdit to prepare posts and publish to my blog.
There is a way to solve this problem with custom CSS.
The posting source is in Markdown. StackEdit translates MarkDown to HTML and posts to the destination. There is not much I could do with the Markdown. However, the theme on the WordPress blog allows me to set a CSS for particular content.
The code blocks are translated to
pre blocks in the HTML. So adding a custom rendering for
pre block should fix the problem.
I found a CSS snippet from https://wp-mix.com/css-style-pre-tags/.
border: 1px solid #777;
background: url('lines.png') repeat 0 0;
Another good reference is https://perishablepress.com/perfect-pre-tags/
This made the code look much much better.