Highlighting source code in my blog article

I write articles on my blog, and I need to highlight the source code (java, php or something else) with special colors, like here in stackoverflow with the <pre> ; could you tell me which option should i use on my blog? You can take a look at the blog to understand what I mean. Thanks in advance.

+4
source share
3 answers

Stackoverflow uses google prettify

For the simplest use, simply decorate the pre tags with the PrettyPrint class.

+6
source

You can use Highliter syntax code to highlight code in blog posts. To do this, you need to install some code on the blogger page editHtml, you must add the Highlither syntax of the code to the blogger template.

Afger posts to your blog, if any html or java code appears, then you need to convert it with escaped code.

The main problem with this method is that all brackets must be HTML escaped, for example, all < must be replaced with &lt; This will ensure proper rendering.

Set up SyntaxHighlighter on your blog.

0
source

If you use IntellIJ, you can export as HTML, which is really good and works for me.

0
source

All Articles