code: function (start) {
          var container, parent, sibling, siblingName, root;
  
          container = parent = start ? startContainer : endContainer;
          siblingName = start ? 'previousSibling' : 'nextSibling';
          root = dom.getRoot();
  
          // If it's a text node and the offset is inside the text
          if (container.nodeType === 3 && !isWhiteSpaceNode(container)) {
            if (start ? startOffset > 0 : endOffset < container.nodeValue.length) {
              return container;
            }
          }
  
          /*eslint no-constant-condition:0 */
          while (true) {
            // Stop expanding on block elements
            if (!format[0].block_expand && dom.isBlock(parent)) {
              return parent;
            }
  
            // Walk left/right
            for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) {
              if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling) && !isBogusBr(sibling)) {
                return parent;
              }
            }
  
            // Check if we can move up are we at root level or body level
            if (parent === root || parent.parentNode === root) {
              container = parent;
              break;
            }
  
            parent = parent.parentNode;
          }
  
          return container;
        }
docs: This function walks up the tree if there is no siblings before/after the node