**Steps to replicate the issue** (include links if applicable):
* Browse to https://ar.wikipedia.org/w/index.php?title=%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D8%AC_%D8%A7%D9%84%D8%B5%D9%88%D8%A7%D8%B1%D9%8A%D8%AE_%D8%A7%D9%84%D8%A5%D9%8A%D8%B1%D8%A7%D9%86%D9%8A%D8%A9&action=edit&cm6enable=1
* Scroll down
**What happens?**:
Eventually everything is either highlighted as green (same color tags are supposed to have), or purple (templates). Or, you may see no highlighting at all.
Replacing all content with more RTL content (LTR seems fine for some reason?) puts CodeMirror in a broken state, and might even produce errors.
Repro steps to cause error (must be on the `master` branch):
* Open an editor with the content from https://ar.wikipedia.org/w/index.php?title=%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D8%AC_%D8%A7%D9%84%D8%B5%D9%88%D8%A7%D8%B1%D9%8A%D8%AE_%D8%A7%D9%84%D8%A5%D9%8A%D8%B1%D8%A7%D9%86%D9%8A%D8%A9&action=edit&cm6enable=1
* Save the page, let's call the page title "RTL test" (note also the page language needs to be something in RTL)
* Go to https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%9B%D7%A0%D7%99%D7%A7%D7%94_%D7%A7%D7%9C%D7%90%D7%A1%D7%99%D7%AA&action=edit and copy the content to your clipboard
** Also note that syntax highlighting works fine for this article
* Edit the "RTL test" page
* With the content scrolled to the top, hit {key Ctrl A} to select all content
* Paste the content from your clipboard that came from [[ https://he.wikipedia.org/wiki/%D7%9E%D7%9B%D7%A0%D7%99%D7%A7%D7%94_%D7%A7%D7%9C%D7%90%D7%A1%D7%99%D7%AA | מכניקה קלאסית ]]
* Scroll up and observe errors
**What should have happened instead?**:
Syntax highlighting should work as expected.
**Other information**:
This is a rather extreme example, being one of the largest articles on Arabic Wikipedia. Maybe things breaking is expected here.
What we should prevent however are the errors that can happen. Perhaps automatically disable CodeMirror due to performance reasons and show a message stating such, or something?