In Summernote, one can easily insert a text like so:
$('#summernote').summernote('editor.insertText', 'hello world'));
One could also insert a node like so:
$('#summernote').summernote('insertNode', node);
When inserting the Node, the cursor conveniently stays within the boundaries of the tag, for example when inserting the kbd tag, the cursor stays in between : <kbd> Cursor </kbd>
My question is how could one insert a text (not a tag) like "aa" and maintains the cursor in between the the two a's "a cursor a". So the only thing that I can think of is to control the cursor which I don't know how after many hours of researching. It doesn't have to be through cursor control if one knows a better way.