docs: function(method, restoreScrollPosition) {
        var body                  = this.doc.body,
            oldScrollTop          = restoreScrollPosition && body.scrollTop,
            oldScrollLeft         = restoreScrollPosition && body.scrollLeft,
            className             = "_wysihtml5-temp-placeholder",
            placeholderHtml       = '<span class="' + className + '">' + wysihtml5.INVISIBLE_SPACE + '</span>',
            range                 = this.getRange(true),
            caretPlaceholder,
            newCaretPlaceholder,
            nextSibling, prevSibling,
            node, node2, range2,
            newRange;
  
        // Nothing selected, execute and say goodbye
        if (!range) {
          method(body, body);
          return;
        }
  
        if (!range.collapsed) {
          range2 = range.cloneRange();
          node2 = range2.createContextualFragment(placeholderHtml);
          range2.collapse(false);
          range2.insertNode(node2);
          range2.detach();
        }
  
        node = range.createContextualFragment(placeholderHtml);
        range.insertNode(node);
  
        if (node2) {
          caretPlaceholder = this.contain.querySelectorAll("." + className);
          range.setStartBefore(caretPlaceholder[0]);
          range.setEndAfter(caretPlaceholder[caretPlaceholder.length -1]);
        }
        this.setSelection(range);
  
        // Make sure that a potential error doesn't cause our placeholder element to be left as a placeholder
        try {
          method(range.startContainer, range.endContainer);
        } catch(e) {
          setTimeout(function() { throw e; }, 0);
        }
        caretPlaceholder = this.contain.querySelectorAll("." + className);
        if (caretPlaceholder && caretPlaceholder.length) {
          newRange = rangy.createRange(this.doc);
          nextSibling = caretPlaceholder[0].nextSibling;
          if (caretPlaceholder.length > 1) {
            prevSibling = caretPlaceholder[caretPlaceholder.length -1].previousSibling;
          }
          if (prevSibling && nextSibling) {
            newRange.setStartBefore(nextSibling);
            newRange.setEndAfter(prevSibling);
          } else {
            newCaretPlaceholder = this.doc.createTextNode(wysihtml5.INVISIBLE_SPACE);
            dom.insert(newCaretPlaceholder).after(caretPlaceholder[0]);
            newRange.setStartBefore(newCaretPlaceholder);
            newRange.setEndAfter(newCaretPlaceholder);
          }
          this.setSelection(newRange);
          for (var i = caretPlaceholder.length; i--;) {
           caretPlaceholder[i].parentNode.removeChild(caretPlaceholder[i]);
          }
  
        } else {
          // fallback for when all hell breaks loose
          this.contain.focus();
        }
  
        if (restoreScrollPosition) {
          body.scrollTop  = oldScrollTop;
          body.scrollLeft = oldScrollLeft;
        }
  
        // Remove it again, just to make sure that the placeholder is definitely out of the dom tree
        try {
          caretPlaceholder.parentNode.removeChild(caretPlaceholder);
        } catch(e2) {}
      }