Every single time I write a post that contains source code, it’s a bloody struggle.
Take my previous “snippets” entry.
Normally, I draft it and plan it in advance, and use Editpad Pro on my windows machine to write it out. Now, in a ideal universe where stuff works properly, I would be able to just paste the code in without putting dumbass escapes- that’s what the CMS is supposed to do, manage my content- but no such luck. So, I replace all < with < and all > with > and all that drollish crap that people use software to avoid. It’s especially fun when the blog helpfully assumes I am using some secret tag when I use generics.
Anyway, first problem: well, some of my swapping was wrong. Second, everything was double-spaced thanks to the magic of me making the original textfile on a windows machine (crlf versus just cr).
I had to actually get the original source from the project I based the post on, perform the replacement, paste it into the proper tag, and hope the gods of blog software were smiling upon me.
Long story short- Putting code in posts is more painful than it should be. I sort of expected the add-in I use for highlighting and code blocks to have been smart enough to properly mark-up the text itself without intervention, but no such luck.
334 total views, 2 views today