plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js
function(html) {
      var range     = rangy.createRange(this.doc),
          node = this.doc.createElement('DIV'),
          fragment = this.doc.createDocumentFragment(),
          lastChild;

      node.innerHTML = html;
      lastChild = node.lastChild;

      while (node.firstChild) {
        fragment.appendChild(node.firstChild);
      }
      this.insertNode(fragment);

      if (lastChild) {
        this.setAfter(lastChild);
      }
    }
function(html) {
      var range     = rangy.createRange(this.doc),
          node = this.doc.createElement('DIV'),
          fragment = this.doc.createDocumentFragment(),
          lastChild;

      node.innerHTML = html;
      lastChild = node.lastChild;

      while (node.firstChild) {
        fragment.appendChild(node.firstChild);
      }
      this.insertNode(fragment);

      if (lastChild) {
        this.setAfter(lastChild);
      }
    }
function ( html ) { var range = rangy . createRange ( this . doc ) , node = this . doc . createElement ( 'DIV' ) , fragment = this . doc . createDocumentFragment ( ) , lastChild ; node . innerHTML = html ; lastChild = node . lastChild ; while ( node . firstChild ) { fragment . appendChild ( node . firstChild ) ; } this . insertNode ( fragment ) ; 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