Comment functionality

Posted Jun 03, 2004 in si-blog.

I've been thinking about how to handle comments in the new si-blog. At the moment, I simply encode everything, and then automagically convert URLs into clickable links. I was planning to change this to require well-formed XHTML instead; however, I am concerned about my non-geek readership.

With that in mind, I was thinking about having a radio button choice like this:

Comment Type Plain text comments (auto line breaks)
Well-formed XHTML comments

Naturally, there would be more extensive posting guidelines besides what I've shown above, but you get the general idea. I would be interested in hearing from some of my readership on this matter. Incidentally, I've tweaked the visual design of the way comments are displayed. I might incorporate the look in the future redesign.


  1. Gravatar

    I'm not positive, but I think Andrei over at design by fire has something of a mix going on for posting. Like, no need for paragraph tags, and you can use more advanced tags if you'd like.

    So I guess a choice may not be necessary, you'd just have to be careful to not wrap any other tags with <p>'s.

    (the categories here are new, no? And thanks for the smilie!)

    Posted by Mike P. on Jun 03, 2004.

  2. Gravatar

    I have seen the mixed approach, and it leaves me a little uneasy. I want a solution that will be completely idiot proof for the web novice, yet I still want the savvy user to have the opportunity to use XHTML if preferred.

    I added "si-blog" and "database" categories a week ago, but everything else is still the same. What do you think about the grad on the comments?

    Posted by Simon Jessey on Jun 03, 2004.

  3. Gravatar

    I think the grad. is a great compliment to the header image.

    Anyway. On my weblog you can use any XML (so you could use <jessey/> if you wanted to) and it will all go into the database. However, only certain elements and attributes will actually be parsed. These elements and attributes happen to comply the XHTML1.0Strict and XHTML1.1 DTD's.

    The fun doesn't end there though... now catch this. If some real web standards savvy visitor wants to markup his or her comment using XHTML paragraphs and line breaks, he or she is free to do so. However, if somebody less savvy (or more lazy, or whatever) decides not to, then hard returns will be converted accordingly (when parsed, not in the database). In any event, paragraphs are marked up with p tags, but p elements are never nested (which would be illegal according to the DTD's my site complies to).

    This also works for more trivial things like em dashes. Whether you mark it up as &mdash; or as -- doesn't matter, they will both be parsed as an em dash.
    Another nice detail is that--since everything goes into the database--I can change which tags are parsed (and how) and which are not at any time--great for forwards compatibility.

    I love the way this works, but it's not so easy (for me) to explain how it does [work]. If it's any help; it's powered by Movable Type's Sanitize features in combination with John Gruber's Markdown plugin.

    Perhaps at least the phylosophy behind this, rather than the actual code, can be of any inspiration.

    Keep us informed. :)

    Posted by ACJ on Jun 03, 2004.

  4. Gravatar

    That sounds like a perfect system; however, I am determined to devise my own mechanism. You see, my motivation for rebuilding is really about needing to flex the web design muscle. I would like to push myself into doing hard things, to help me better learn PHP, and some of the techniques required to make a CMS work. I hope that I'll be a better developer at the end of the process.

    Posted by Simon Jessey on Jun 03, 2004.