This approach had a couple of drawbacks:
- Highlighting is based upon HTML tags. Hence code edition is a cumbersome task since the easiest way to do it is to take te code snippet back to tohtml.com, edit it, generate the HTML code again and replace it in the post.
- The generated HTML code doesn't use CSS. So customizing it is hard and changing its style requires to generate the code again.
- The code snippet is part of the articles text so its width is limited. This affects readability and requires some custom line breaking.
Using this approach overcomes the first and third drawbacks. And the second is not a serious problem since now code snippets appear enclosed into a text box, so even if I would change the background to a dark color, snippets will still look good.
The only disadvantage is that I lose the possibility of highlighting parts of the code snippet (e.g. using a bold font or yellow marker style for just one line), but I certainly like it much more the way code snippets look in the blog now.