code: def count_lines_to_next_cell(cell_end_marker, next_cell_start, total, explicit_eoc):
      
      if cell_end_marker < total:
          lines_to_next_cell = next_cell_start - cell_end_marker
          if explicit_eoc:
              lines_to_next_cell -= 1
          if next_cell_start >= total:
              lines_to_next_cell += 1
          return lines_to_next_cell
  
      return 1
docs: How many blank lines between end of cell marker and next cell?