Block is considered empty when it has nothing but spaces.
function isEmptyBlock(node) {
    if (!node.length) return true;

    return !node.content.some(function(node) {
      return !node.is('space');
    });
  }