Tigraine

Daniel Hoelbling-Inzko talks about programming

Post Code with Dignity

Posted by Daniel Hölbling on June 16, 2008

After finally getting really really fed up with Windows Live Writer about the way it tries to tidy up your HTML code I decided that I need to do something about it.

So I did, writing a Live Writer plugin is very easy and straight forward, so I did a plugin that will take your clipboard, replace typical things like < > through &lt; &gt; and replace every 2 spaces through 2 &nbsp;.
So make sure you are using a even number of spaces for source indentation in your IDE.

The plugin is far away from perfect, and I think I'll make it a bit more configurable tomorrow. I also think I'll put it up on Google code and maybe release it to the Windows Live Gallery.

They key? Windows Live Writer fucks up your markup no matter what you do. So I simply departet from posting pure text as a ContentSource, yet the plugin is treating HTML as a SmartContentSource that will appear as a block inside Windows Live Writer, saving it from it's catastrophic markup-killing html-tidy algorithm.

Update: I already released the source at CodePlex and you can get the most up to date binary from there:

CodePlex Project Page: http://www.codeplex.com/wlwPostCode

Installation:
Simply put the dll into your Live\Writer\Plugins directory and start WLV!
It will now show up in your Insert-List as Insert Code..

Btw: The Plugin assumes you are using the same syntax highlighting script as I do and will put your code into a <pre> tag.

Filed under net, programmierung
comments powered by Disqus

My Photography business

Projects

dynamic css for .NET

Archives

more