For the Masses: WYSIWYG Comments for Wordpress

By jaymis

Peter and I have been talking about implementing WYSIWYG editing for Wordpress comments for a while now. WP’s comments system is reasonably robust, but the HTML instructions seem to confuse some people:

XHTML: You can use these tags: <a href=”" title=”"> <abbr title=”"> <acronym title=”"> <b> <blockquote cite=”"> <cite> <code> <del datetime=”"> <em> <i> <q cite=”"> <strike> <strong>

We quite often receive comments to out sites in which people - probably those unfamiliar with HTML - have taken these instructions to heart and created comments which look a little like this:

You can check it out <a href=”http://example.com” title=”here”>, more updates should be coming soon.

This can cause issues for the site as a whole: Wordpress doesn’t detect this error and close that anchor tag, so the rest of the comment becomes a link, which encompasses everything down the page until the next link in the code is closed. The same kind of thing happens when people put unclosed <strong> tags in their comments. We don’t have any closing </strong> tags in the page source after the comments, so when someone does this the rest of the site becomes emboldened until an administrator corrects the comment.

These kind of errors notwithstanding, WYSIWYG is perfect for comments. I don’t like WYSIWYG editors making decisions for me in my day-to-day coding life, as they rarely output exactly what I want them to, but writing comments is such a constrained activity; with a small number of tags available, the editor can’t really stuff things up too badly.

I’ve previously hacked a cut-down version of TinyMCE into our test bbPress installation. This was relatively simple, so I’d expected that it wouldn’t be hard to get it happening on the Wordpress comments form as well. I did a quick search first, though, to make sure I wouldn’t be duplicating someone else’s efforts. It turns out I would be, as there’s a Wordpress plugin called TinyMCEComments.

Testing Asides

By jaymis

This is a test aside post, being used for templating. Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of “de Finibus Bonorum et Malorum” (The Extremes of Good and Evil) by Cicero, written in 45 BC.
Testing Internal Trackback.