Post codes to blog posts/comments with Postable

Have you gaped in utter disbelief when the code you just posted on a blog (via post/comments) came back as some mumbo-jumbo, or even worse, broken that beautiful design? It happens all the time, thanks to the nature of HTML.

There may be HTML characters embedded in the code, which the browser renders, causing 101 million errors. It has happened to most bloggers, and there are many methods to stop it. You can open up a text editor, and find/replace all the characters that you want to fix. This may work with simple code which contains only a few angular brackets (eg: <).

However, if you are posting something more complex, say some PHP code which has angular brackets, double-inverted commas, slashes etc., you are in trouble. The need, then, would be for a tool which takes the code, and spits out browser friendly code. This ensures that there are no wreckages broken designs.

Postable is one such tool. The interface is clean and elegant, with a web 2.0 look (gradient background) which is just enough. I’ve lost count of the number of sites that have gloss and reflection everywhere. Thankfully, the design of Postable is really clean. My only gripe with it would be the colour palette used for the design. See the image below to understand what I mean.

Postable
Ain’t the design gorgeous?

The developer of the tool is Elliot Swan.

Absolutely hate having to switch all the “<” and >” signs in my code to “&lt;” and “&gt;”, respectively. I also hate having to write “&amp;” anytime I want to include an ampersand. This makes including code snippets on my blog and whatnot extremely annoying, and today I finally got fed up (more)…

The name, “Postable”, is written in large letters (sans reflection). There is a code box, and a simple button named “make it friendly” below. It is AJAXed, which saves you a reload of the page. I tested it on a slow connection, and it managed to load quite fast. The scripts working behind the screen are Prototype and Scriptaculous JS library, along with a custom script.

The only nag that I have found is that it does not accept more than 5000 characters. But this is a no-brainer, as I am yet to come across anyone who needs to post more than that amount.

I am happy that I found this tool, as it makes posting code a breeze. I had earlier used the previously-mentioned method of find/replace, which was stupidly slow, not to mention the inaccuracy.

Go to Postable.

Leave a comment

Your email address will not be published. Required fields are marked *