Use selection.addRange(range) for insert html near default text, but this action doesn't save into history of input, and when i use ctrl+z, undo previous action, not change(insertNode)
I need, that when I use ctrl+z, action undo
detach my html, which i insert before
i'l do this like that:
let node = target_fragment.appendChild(target.firstChild);
range.insertNode(target_fragment);
range = range.cloneRange();
range.setStartAfter(node);
range.collapse(true);
selection.removeAllRanges();
selection.addRange(range);