code: function getNodeForCharacterOffset(root, offset) {
    var node = getLeafNode(root);
    var nodeStart = 0;
    var nodeEnd = 0;
  
    while (node) {
      if (node.nodeType === TEXT_NODE$3) {
        nodeEnd = nodeStart + node.textContent.length;
  
        if (nodeStart <= offset && nodeEnd >= offset) {
          return {
            node: node,
            offset: offset - nodeStart
          };
        }
  
        nodeStart = nodeEnd;
      }
  
      node = getLeafNode(getSiblingNode(node));
    }
  }
docs: Get object describing the nodes which contain characters at offset.
  
  @param {DOMElement|DOMTextNode} root
  @param {number} offset
  @return {?object}