Let’s say I want to implement copy/paste of the annotations in ProseMirror collab example. I would need somehow to add the ranges of the annotation to the clipboard. I thought of the following methods:
- add the ranges with
transformCopied
. This would either add attributes to some existing node or add a new node to track the range. The downside is that I would need to modify the schema. - implement a custom copy event handler. It’s much more complex, and I it might be problematic if multiple plugins need to add metadata.
- add the ranges to the copied html with a custom
clipboardSerializer
. This would only work for “static” metadata, since I can not access the state in the serializer. It would also be problematic with multiple plugins adding metadata.
Is there a better way?
Thanks!