function(html) {
      var range     = rangy.createRange(this.doc),
          node      = range.createContextualFragment(html),
          lastChild = node.lastChild;
      this.insertNode(node);
      if (lastChild) {
        this.setAfter(lastChild);
      }
    }
function(html) {
      var range     = rangy.createRange(this.doc),
          node      = range.createContextualFragment(html),
          lastChild = node.lastChild;
      this.insertNode(node);
      if (lastChild) {
        this.setAfter(lastChild);
      }
    }
function ( html ) { var range = rangy . createRange ( this . doc ) , node = range . createContextualFragment ( html ) , lastChild = node . lastChild ; this . insertNode ( node ) ; if ( lastChild ) { this . setAfter ( lastChild ) ; } }
Insert html at the caret position and move the cursor after the inserted html

@param {String} html HTML string to insert
@example
selection.insertHTML("<p>foobar</p>");
Insert html at the caret position and move the cursor after the inserted html