I've always struggled to make the code look good/readable with my blog posts. The way my WYSIWYG test editor isn't the greatest when it comes to code. I recently came across something called carbon, which you can visit and try for yourself here - https://carbon.now.sh/
You can clone the repo (I believe) or use the website. For now I am using the website to see how my text editor takes it. Let's give it a try. This is a random bit of code from a spreadsheet I wrote. First one is pasted as an iframe.
*note* the iframe didn't display correctly so I removed that text.
Looks like with an iframe it links back to carbon's site. Otherwise an image is possible. But doesn't allow the reader to copy.
It also comes as a plain URL as below.
The URL allows viewer to copy, but it's unknown how long that link will work. All of the code is inside the link so as long as carbon is up it should work.
There are many different color combos, background colors, code choices, and output options. Looks like there is even a tweet and a medium option.
Let's see how it looks!