Attempt at a WYSIWYM edit mode. Best way to replace the default textarea?

Hi! To preface this, I’m not a web/javascript developer, though I managed to piece together a working WYSIWYM editor. The way it works is by replacing the default text area with a CodeMirror editor.

I just wanted to ask what is the preferred way to do this, maybe with the plugin API? Right now, I’m just using a MutationObserver to check for a textarea and replace that, but as you can see in the attached gif, the textarea shows up briefly (although gif compression exaggerates the amount of time the textarea shows).

wysiwym

1 Like

Welcome. I don’t think that there is currently another option than a MutationObserver. Could possibly avoid the brief show-up with some css.

Thanks, for the CSS idea, it’s still a bit awkward that the content disappears for a bit but better than the text area showing up :smiley:
wysiwym

1 Like