I'm using ckEditor and am working on snippets/text-replacement functionality. I have snippets that are either plain text strings or HTML strings (such as paragraph elements). I'm using document.execCommand('inserthtml', false, html) to do my content insertion, and it works fine in most cases.
However, when I attempt to use this method to insert content into a table cell, the content winds up in the cell after the one the cursor's in, or outside the table if the cursor is in the last cell.
My searching hasn't turned up much information on this situation, and I don't really understand why Chrome would act this way. Is it intended behavior? Is there a better way to insert arbitrary html, maintaining cursor position?