Issues with marks when using ProseMirror-Invisibles

Hi there! I’m pretty much new to ProseMirror, but from the first view I liked the flexible architecture, especially plugins and other possibilities to extend the editor.

We are using ProseMirror-Invisibles on the project, and have encountered a problem. Actually, bug occurs when two fragments have styles, for example bold. And then you try to uncheck the first style or add new between ones.


We have reduced the code to a minimal example on Glitch to show the problem, and would be grateful for some help.

Best regards, Vlad

I’m seeing all kinds of other issues in that demo. I’m not sure how solid or well-supported prosemirror-invisibles is. Maybe try opening issues there.

Thanks for the reply! Concerning prosemirror-invisibles on github - we already created an issue in 2019.

But it seems that it’s no chance to get an answer. That’s why we are trying to find some help here. That’s would be very nice if you could share your vision concerning this bugs and maybe give a direction in which should we move to solve this.

No, I don’t intend to provide support for other people’s packages.

I’m not sure copy-pasting a library into your glich project counts as reproducing without the library, but okay, I’ll go along. This was indeed a ProseMirror issue—the widgets were created with raw DOM nodes (rather than functions creating DOM nodes) passed to Decoration.widget (which is recommended against in the docs), and in the editing scenario you show that made ProseMirror mess up and try to put the same DOM node in the document multiple times, crashing in the process.

This patch should help with this.

Thanks a lot for the patch!

Yeah copy-pasting is not the best way to show the problem usually, we will try escape this next time. But it’s really nice to get very detail answer and understand what was wrong. I hope this will help others as well to use ProseMirror and be happy with it.

Best regards, Vlad