I am working on a text editor with some user applied formatting (bold, colors and such). I am trying to implement copy pasting of text including markers.
Is there some clever way of doing that in CodeMirror?
If not my idea goes like this:
- Hook into the copy event and get the selected text including markers into a copy buffer
- Hook into paste event and insert copied text and apply copied marks (where position of marks is transformed with current cursor location) at desired location.
- Handle all kinds of edge cases (pasting on top of some selected text, and what not)
How does that sound?