code: def strip_html_comments(text):
      
      lines = text.splitlines(True)  # preserve line endings.
  
      # Remove HTML comments (which we only allow to take a special form).
      new_lines = filter(lambda line: not line.startswith("<!--"), lines)
  
      return "".join(new_lines)
docs: Strip HTML comments from a unicode string.