I am dynamically appending CodeMirror instances wrapped in a “widget” div to the body, and enabling the user to change the code mode on selection change.
When I change the code mode, the
span tags wrapping the text in the editor are being removed, thus removing any styling by the “cm” classes along with them…
How can I stop this?
Here is my codepen: https://codepen.io/Souleste/pen/WqVdXd