Utility class for performing content insertion.
Inserts content into the editor (specified selection) as one would expect the paste functionality to work.
If an instance of
Selectionis passed as
selectableit will be modified to the insertion selection (equal to a range to be selected after insertion).
selectableis not passed, the content will be inserted using the current selection of the model document.
model : Model
The model in context of which the insertion should be performed.
content : DocumentFragment | Item
The content to insert.
[ selectable ] : Selectable
Selection into which the content should be inserted.
[ placeOrOffset ] : Number | 'before' | 'end' | 'after' | 'on' | 'in'
Sets place or offset of the selection.
Range which contains all the performed changes. This is a range that, if removed, would return the model to the state before the insertion. If no changes were preformed by
insertContent, returns a range collapsed at the insertion position.