Thread:Extension talk:WYSIWYG/Event fired when switching to/from wikitext view ?/reply (2)

In fact, setData works, if is placed in a instanceReady event. For example, with this code I can replace ... tags or templates into « ... » :

According to the tests I've made (may be not exact) :
 * The event setData is fired two times, when switching in source -> wysiwyg direction
 * toHtml and toDataFormat event are not fired at all
 * listeners don't have effect

I don't know how to catch event in wysiwyg -> source direction