docs: def cut_references(text_lines):
      """Return the text lines with the references cut."""
      ref_sect_start = find_reference_section(text_lines)
      if ref_sect_start is not None:
          start = ref_sect_start["start_line"]
          end = find_end_of_reference_section(text_lines, start,
                                              ref_sect_start["marker"],
                                              ref_sect_start["marker_pattern"])
          del text_lines[start:end + 1]
      else:
          current_app.logger.warning("Found no references to remove.")
          return text_lines
  
      return text_lines