Appears to be fixed by using className: instead of class: for the attr key. Not sure if that’s a ProseMirror thing or a JS thing or something else entirely.
Signed up here just now to ask this same question!
My schema is a node spec for a link with a data attribute and a class attribute, but when you cut/copy and paste within the editor these attributes are lost (they are not set to defaults as in @Mansehej’s post, they are just completely missing). The href attribute comes through correctly.
Not sure what’s going on here as this is written pretty much identically as the dino example, which does maintain the extra attributes through cut+paste.
Any help understanding this would be greatly appreciated
EDIT: this is basically done in the prosemirror-example-setup
AHH fixed it (although this doesn’t fix @Mansehej’s problem, so please help him out).
Forgot that there was a mark in the schema for “a” tags as well, and that was parsing with higher priority than this wikilink node spec, when the content was pasted.
So now it seems a little strange that they were parsing correctly when the initial content was assigned to the editor. Perhaps whether nodes or marks are parsed first is non-deterministic?