Sam Newman's site, a Consultant at ThoughtWorks

Thanks to some code from “Stuart Langridge”:, I’ve managed to implement a live comment system supporting “Textile”: Originally inspired by “Jon Hick’s”: comment system, as you type comment the text is parsed and formatted as HTML, and inserted into another div. The Javascript doesn’t support all Textile formatting, but supports all of the quick tags (apart from Span) and some of the block formatting (such as blockquotes). I may add support for more of Textile’s formatting commands later – I’ll see how much people use it. Anyway, feel free to give it a go and “let me know(Contact Me)”: if you experience any problems.

11 Responses to “Live textile comment previews”

  1. sil

    I’m afraid it’s not working in Firefox: there’s a “reloadPreviewDiv is not defined” error…

  2. Sam Newman

    Try a shift-reload – I rebuilt the javascript file I included after I rebuilt my blog, so you might have the wrong version cached.

  3. sil

    ah-ha! That makes sense. And fixes the problem. Duh 🙂
    Gotta love Textile. Although it does pass HTML through; I’ll assume (without testing) that your back end kills bad HTML 🙂

  4. Sam Newman

    Yep – the backend excludes html, even if the comment-preview doesn’t. Oh well, you can’t have everything…

  5. e-null


    Your article on SimpleDateFormat really open my eyes. I think I will switch to jakarta’s commons Date Formatters from now on.

    I want to comment on something,I am not trying to insult on anything but this really caught my attention. Currently I am using IE on XP. And I notice that some of your pages get elongated. For example in this page, there is a huge gap between the last comment and the Post A Comment header.

  6. Sam Newman

    Yep – its a very annoying float bug somewhere. I’m trying to track it down, but have been sidetracked by any number of other things! In anycase I hope to have a site redesign done in the next couple of months, so it might sort itself out.

  7. Jeff Minard

    Sweetness – I’m going to use this on my own site 😀 Heck, might even include it on my admin system for posting entries.

    “ website)”:

    *Mucha’s gracias!* -err, that ! throws of the JS regex it seems

  8. sosa

    *Thank you very much* this is what i was looking for.
    I will use this in my site if you don’t care.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Basic HTML is allowed. Your email address will not be published.

Subscribe to this comment feed via RSS

%d bloggers like this: