I have a schema with a “list” node that can contains only “item” nodes:
schema.nodes.mylist = {
type: MyList,
content: 'myitem*'
};
Now depending on some attribute set on a “list” node, i would like to dynamically restrict schema to be
schema.nodes.mylist = {
type: MyList,
content: 'myitem[name="title"] myitem[name="description"]'
};
or
schema.nodes.mylist = {
type: MyList,
content: 'myitem[name="email"]'
};
and so on.
This way i could tell prosemirror to keep the right items in the right places (impossible to remove or split an item, for example).