How to understand the parameter `typesAfter` of the method `Transform.split()`?

https://prosemirror.net/docs/ref/#transform.Transform.split

How to understand the parameter typesAfter of the method Transform.split()?

I’ve defined the nodes of the dl-dt-dd tag. I want to create a dd node when the cursor is at the end of the dd node and press the Enter key.

I tried to assign parameter typeAfter to null, [null, {type: ddType}], [{type: ddType}] or [{type: ddType}, {type: ddType}]. However, it still create a new dt node unexpectedly.

I assign the content property of dl node’s schema to content: '(dt dd*)+ .

Could someone help me ?

Is the dd node a textblock, or does it contain further block nodes? If it’s a textblock, I’d expect [{type: ddType}] to work.

(To make sure this isn’t an issue with content matching, have you checked whether parsing a document like <dl><dt>a</dt><dd>b</dd><dd>c</dd></dl> works?)

Thanks for your reply.

dd: {
	content: 'inline*',
	defining: true,
	draggable: false
},
dt: {
	content: 'inline*',
	defining: true
},
dl: {
	content: '(dt dd*)+',
	group: 'block'
}

parseDOM and toDOM are omitted for brevity.

Other options follow the default settings.

I confirm that dl><dt>a</dt><dd>b</dd><dd>c</dd></dl> works fine.

Interesting. Could you set up a minimal demo of the problem? (A schema with the definition list nodes + the command you wrote.) An easy way to do this would be to ‘remix’ the basic demo with glitch.