I want to use YUI when someone selects the Filtered HTML input format (default), but use markItUp! when they select the Markdown input format, and use no textarea enhancer at all when Full HTML is selected. I put together some code to remove YUI when something other than Filtered HTML is selected, but due to the way the configuration settings are being passed to the Editor, I can't find a good way to re-add YUI Editor if someone re-selects Filtered HTML.

Calling YAHOO.util.Event.DOMReadyEvent.fire() gets so close, but it's a hack, and it causes some interface elements to be repeated… If I try to re-add it twice, I end up with two YUI editors (zomg!).

Re-initializing it by creating a new YAHOO.widget.SimpleEditor works better, but I can't access the configuration object that was used to originally create the Editor, so the interface is all wrong.

Is there a good way around this? If not, would it be possible to refactor the code so that the configuration object is accessible to outside code (or maybe even add built-in functions to add and remove the editor)?

(Thanks to @yui_am at irc:irc.freenode.net/#yui for helping me get this far.)