Is there any way to exclude one type in schema's content expression

hey guys!

I am wandering that is there any way to exclude one specific type in schemaSpec’s content expression, for example, table_cell schemaSpec’s content is “block+”, however i want to exclude heading.

Now i have to list all types but heading in the content which makes it hard to further maintenance.

What I expected is to have some enhanced expression to achieve that, maybe something as “block[^heading]+”, is there any way i can do that ?

Nope. You’ll have to assign all the types that are allowed there to some additional group.

ok! thanks!

One way to manage rules like that is to define a new group name and then add all relevant nodes to that group.

For example, you could set table_cell to have content: 'tablecontent+' and then add group: 'tablecontent' to the schema for each block node except for heading.

Node specs can have multiple (space-delimited) groups, so you could have a node that belongs to multiple groups.

e.g.

image: {
   ...
   group: 'tablecontent listcontent',
   ...
}

hahah , many thanks! Now i have a “cellContent” group to manage my table_cell’s content .