Posting source code in blogger- fails with C# containers
- by Lirik
I tried the solutions that are posted in this related SO question and for the most part the code snippets are working, but there are some cases that are still getting garbled by Blogger when it publishes the blog.
In particular, declaring generic containers seems to be most troublesome. Please see the code examples on my blog and in particular the section where I define the dictionary (http://mlai-lirik.blogspot.com/).
I want to display this:
static Dictionary<int, List<Delegate>> _delegate = new Dictionary<int,List<Delegate>>();
But blogger publishes this:
static Dictionary<int, list=""><delegate>> _delegate = new Dictionary<int, list=""><delegate>>();
And it caps the end of my code section with this:
</delegate></delegate></int,></delegate></int,>
Apparently blogger thinks that the <int and <delegate> portion of the dictionary are some sort of HTML tags and it automatically attempts to close them at the end of the code snippet. Does anybody know how to get around this problem?