Sneaky Abstractions

Subscribe to my Feed, follow me on , recommend me on Working With Rails or see my code on GitHub

Meet Sanskrit, the Rich Textile Editor

Posted on June 03, 2007 22:25 Tagged with sanskrit, javascript, textile.

Sanskrit is a simple “rich-text editor” with no bells or whistles, and it outputs Textile instead of XHTML. It’s meant to be safe (with regards to XSS, hence Textile) and simple. It only works with the most basic (inline) text styles.

This is my very first time writing something that resembles a library in JavaScript, so it’s probably full of bad practises, errors and generally smelly code. If you have tips for improvement, please let me know. I’ve tested this in Gecko, IE6, IE7, Opera 9 and Konqueror (which doesn’t support this kind of stuff, but the fallback to a normal textarea works), but if you find that it doesn’t work in a browser (and preferrably how to fix it :), please let me know about that too.

I’m Sheriff John Bunnell, when you hear police sirens it means one of two things; someone is in trouble or someone is causing trouble. In the next hour, we’re gonna show you trouble, up close, the way the police see it every single day. So fasten your seatbelts, we’re gonna take you for a wild ride.