Posting and Commenting with Code

Ok, I’ve spend all morning trying to figure out how to allow WordPress to accept code in comments — nothing seems satisfactory to me.

I think my code comes out ok (I’m using Windows Live Write to post):

select ‘x’ from dual where 1 > 0 and 2<= 3;

But I know that comments aren’t…

So, I’ve added a link to an HTML formatter for code right above the comment box.  That should allow you to pop open the HTML formatter, drop your SQL into it, convert it and then post it.

Not seamless (I’m still looking), but it should avoid some of the problems from the past few people trying to answer the Prime quiz…

7 Responses to “Posting and Commenting with Code”

  1. Jeremy Schneider Says:

    I’m using Code Markup and I’m pretty pleased with it… my Hierarchical Query post had code in the comments. I also think that the AJAX Comment Preview is a must-have – so that people can see how their comments will look before submitting.

  2. Raj Jamadagni Says:

    comments should at-least respect _pre_ tags.

  3. ddelmoli Says:

    tried Code Markup and <pre> tags. Nothing seemed to handle "less than or equal to" <=

  4. Raj Jamadagni Says:

    Test this is <= and this is >=


  5. Raj Jamadagni Says:

    I had to use following html codes …. &_l_t_; and &_g_t_; for it to show up correctly. The trouble is sqlplus doesn’t like it that way.


  6. ddelmoli Says:

    Yeah, that’s why I added the link to the HTML Encoder — you can write / test code in SQL*Plus, slap it into the HTML Encoder, and then paste it here…

  7. Katherine Hart Says:

    Hey Nick I hope you are feeling better, even if your body isnt hopefully your soul is brighter. You are quite an amazing young man always smiling and saying Hello to me, the crazy lower classman. In the Langley newspaper I always looked for your articles to read first. I plan to keep looking for those articles and I know you have the strength to get through this. You are an amazing person Nick Cafferky dont forget that and keep working hard to get better. My thoughts are with you everyday and so is my love. God bless you and your family.
    get better please!
    love KT Hart (Clark:)

Leave a Reply

Posting code can be a pain. To make sure your code doesn't get eaten, you may want to pre-format it first by using HTML Encoder