Ignore node's children

Hi! I am working on an implementation of ProseMirror that is meant to include custom web components into the document. Our editor has a toggle feature so you can switch from readOnly to editing. When switching to editing, we feed ProseMirror our document and then it turns the document into an editable section.

When we add one of our custom web components, we have an external editor that we use to then add children to this element. These children are not added through ProseMirror.

The elements are added to the doc, but because they are not listed in our schema, they are removed the next time we re-enable the editor on our content.

Is there a way to use a wildcard for a node so that the schema will ignore all of a node’s children? We don’t want ProseMirror to touch these children and we want them to remain exactly as they were added. We will eventually make adjustments to include these pieces into the Schema for other reasons (history, etc…) but for now we just want to get it working with any content.

Thanks so much for your help. We’re all very excited to be using ProseMirror and looking forward to your response! :slight_smile:

1 Like

I think what you need is a node view for the nodes in which these changes happen—those give you full control over a given node’s presentation (while disabling the default editing behavior).

That’s great, thank you! This has set us on the right track. I’ll post a snippet when we have everything settled for anyone else who might find it helpful.

Thanks again for being so responsive, it’s greatly appreciated. Cheers! :slight_smile: