Applying surrounding text formatting/marks during paste

When a user pastes plain text in the middle of a text node that has a bold mark, is there a recommended way of making the pasted text bold as well? The question also applies when a user is pasting HTML (that does not contain an explicit font weight) into some bold text.

Internal Content vs External Content: When a user pastes content without an explicit font weight and the content was copied from within the editor, it is expected that the pasted content will have the default weight. But when pasting content that was copied from outside the editor, it would be nice if the new text took on the font weight of the text it was pasted into. This matches the behavior in Google Docs.

I searched the forums and found some good discussions on paste, but did not find this scenario. This can be done in handlePaste but was wondering if it had been solved by others and if there were plans to include a solution in the core paste functionality.

1 Like

Doing this for plain text paste probably sounds reasonable. For HTML paste, I’m not sure—I can imagine making an exception when the inserted slice is a plain text node, maybe, but distinguishing between text copied from inside the editor and external content seems random. External content might just as well have significant marks.