This came up with many customer requests, and as everyone wants different things, pasting becomes a bit of a “how do we do things” question.
In Word, Microsoft solves the issue of “when pasting, do we match formatting, do we keep the text, etc..” by having a little dropdown menu pop up where the user can select how their text should be interpreted.
For us, the following behaviors need to be available:
- Certain Nodes should be kept (e.g. we have “sections” that can be labeled). By default, only when they are set to
defining
they are kept during paste, but some people would like to havedefining=false
nodes also be kept when pasting - Match formatting and paste
- Paste as raw text (strip formatting)
- Interpret text as Markdown and paste
- Finally, the current default behavior (
defined=false
nodes are lost, etc..)
How would one go about adding this to ProseMirror? Many thanks in advance!