For developers using CodeMirror 5’s API:
If your plugin only does basic things such as:
- Reading/changing selection with
getSelection, getCursor, setCursor, etc.
- Getting text/line from the editor with
getLine, getValue, getRange, etc.
- Changing text in the editor with
replaceSelection, replaceRange, setValue, etc.
Then you can now use MarkdownView.editor instead of MarkdownView.sourceMode.cmEditor and it should just work.
If you do more advanced things with CodeMirror 5’s API, such as inserting widgets, making DOM level changes, adding options, or registering events, then keep your code for CM5 and make your plugin desktop only.