How To Insert Code Snippets in Blogger Post

There’s no native way to insert codes in Blogger (ie – no button on the editor toolbar). However we can manage to overcome the problem.

The easiest way is to write the full content in markdown and then copy it into the blog editor. It comes with full syntax highlighting in the language of your choice.

For example, we can write java code like this:

And the result:

We can write markdown in VsCode, typora or Dillinger Online .

The second way is a little tedious. The steps:

  1. Convert code to html using converters and copy it
  2. Switch the blogger editor to HTML mode and insert the html
  3. Switch back to the Compose mode to see the result

markup.su and hilite.me are two common code snippets converters.

Leave a Reply

Your email address will not be published. Required fields are marked *