I eventually looked at the Clipboard source code and was able to figure it out. Just had to convert the string to a view elements, then to model fragments, then insert. A simple example in the docs would have helped! If this isn't the best way to do it, please leave a comment.
ckeditor.model.change(writer => {
const clipboard = ckeditor.plugins.get('Clipboard');
const view = clipboard._htmlDataProcessor.toView(newText);
const modelFragment = ckeditor.data.toModel(view, '$clipboardHolder');
if (modelFragment.childCount === 0) {
return;
}
ckeditor.model.insertContent(modelFragment);
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…