See CodeMirror docs: https://codemirror.net/examples/bidi/
Background
HTML tags and similar markup may appear jumbled due to the standard algorithm used for character placement in RTL:
CodeMirror should detect such markup and apply bidirectional isolation to it, so that it appears like:
Acceptance criteria
- In CodeMirror 6, HTML and similar tags (such as <ref>) used in wikitext should appear as left-to-right, even on a page using an RTL language.




