Add span Extension

This is a message where mapping is used to determine the appropriate selection position: tr.replaceWith gets wrong selection mapping (codeblocks) · Issue #645 · ProseMirror/prosemirror · GitHub where NodeSelection.findFrom is used instead.

Its possible this may work - I think you are not pointing to the beginning of the newly inserted Node - and if I recall correctly, that is the error message you’d receive but not 100% sure.

This also possibly relevant: Selecting a Block-Level Node after Insertion - #5 by amxmln

But perhaps @marijn could confirm and I think he’d know immediately.