Inserted textnode gets unwanted marks?

I have a transaction and insert a fragment in a given selection like this:

const newSlice = new Slice(Fragment.from(newNode), 0, 0);

Additionally, I need to insert some textnode before and after that newly created Node:

tr.insertText('Before', );
tr.insertText('After',selection.from );

The newly inserted node has 2 custom marks. When the document is empty, and I insert my node, the textnode inserted before my custom node also gets the custom marks. tr.storedMarks is null.

Is this correct behaviour or am I missing something?

Yes, that is how marks behave unless you configure them to be non-inclusive.

Thanks for the confirmation!