A Workaround for Poor Formatting and Copy-Paste Behavior of Code on the Web
Posted by Dan Vanderboom on March 22, 2008
I bought BlogJet for publishing my blog articles, and have struggled with it (sometimes for hours) to get the formatting right, or as close to it as possible. Sometimes I can paste code in it from Visual Studio (to get the color-coding perfect), and other times the color or indentations won’t transfer. Invariably the way it looks when published doesn’t represent the way it looks in the editor itself.
Maybe BlogJet just sucks and there is a better option! With this idea in mind, I downloaded and started using Microsoft Live Writer, which is free and part of Microsoft Live Services. At first I was very happy with it, but soon I realized that it had many of the same problems as BlogJet. What are they doing, copying each others’ bugs?!
So I’m on the lookout for an exceptional blog publishing software package. I’d like to manage categories through it (add, edit, remove), maybe read comments, or at least be able to have an accurate and reliable WYSIWYG experience. If you know of any, drop me a line. I’m willing to pay a premium price for a good thick-client article authoring environment.
In the meantime, I’ve discovered that I can usually get around the source code problem by copying the code first into Microsoft Word, and then copying it from Word and pasting into the blog software. No extra lines, indentation, or color problems so far have occurred with this technique. Why does this work? I have no idea.
Also, if you’re copying code from a webpage such as my blog, and pasting it directly into Visual Studio (or the Macro editor), you’ll notice blank lines between lines of code. If you care, the same trick of copying to Word, and copying from Word to Visual Studio, will steer you around this annoyance.