code: def whitespace(text: str) -> str:
      """
      Replace all contiguous zero-width spaces with an empty string, line-breaking spaces
      with a single newline, and non-breaking spaces with a single space, then
      strip any leading/trailing whitespace.
      """
      text = resources.RE_ZWSP.sub("", text)
      text = resources.RE_LINEBREAK.sub(r"\n", text)
      text = resources.RE_NONBREAKING_SPACE.sub(" ", text)
      return text.strip()
  
file_path: textacy/src/textacy/preprocessing/normalize.py
imports: import re
  import unicodedata
  from typing import Literal
  from .None import resources
label_desc: Use image node_id 6 for calling a global function with example usage: whitespace(text) and returns: text