Battle of the Drupal Rich Text Editors


This post was triggered by my need to use a few websites that are stuck in Drupal 4.6, and as such they have HTMLArea installed.

For Drupal, there are 3 options to choose from when shopping for a rich text editor to be used in content editing textareas.

  1. FCKEditor
  2. HTMLArea
  3. TinyMCE

Of the three, only TinyMCE has an official 4.7 compatible release.

The first two produce absolutely horrid markup. TinyMCE used to be as spectacularly invalid/nonsemantic as the others, but it's received a LOT of love recently and its markup is actually pretty decent now.

HTMLArea produces brutal markup. Silly divs inserted for no apparent reason. Really crazy markup that I have to go in and clean up by hand if I want to make sure the code is tight and correct. That defeats the purpose of a rich text editor.

FCKEditor isn't bad - when weblogs.ucalgary.ca was still on Drupal 4.6, that's what it used. The markup wasn't hideous, but it wasn't great either. It was slightly quirky to use, but it worked (mostly).

Then, weblogs.ucalgary.ca was moved to our shared Drupal hosting environment, which runs Drupal 4.7 - FCKEditor wasn't happy, so I dropped in the CVS build of TinyMCE.module. And the markup was much cleaner. And it integrated with Image.module. And a bunch of other nice stuff like providing a full screen editing mode.

None of them, however, cleanly "disable" themselves so I can get to raw code. Several "meta" pages on the sites have PHP code embedded, which is completely obliterated by the rich text editors. Even clicking the "disable rich text editing" link below the textarea isn't enough because the source text has already been nuked by the javascripts used by the editor. So, I still have to make a round trip to "My Account", edit it, and disable rich text editing for my account until those pages are edited. I've currently left it off by default, and call it into action by hitting the "enable rich text editing" link beneath the textarea. That makes it safe to edit any content in a site without worrying about clobbering stuff that isn't grokked by the editor, while keeping the fancy schmancy WYSIWYG stuff just a single click away.


comments powered by Disqus