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
That was it, along with the fact that I didn’t have the css and html ‘mode’ files, wish there were one file for all modes… Also, I looked at this thinking the way they are written there was correct syntax, but I guess not. Thanks!