distribution-opensuse-1.1.4: Types, functions, and tools to manipulate the openSUSE distribution
Safe HaskellSafe-Inferred
LanguageHaskell2010

OpenSuse.StripSpace

Synopsis

Documentation

stripSpace :: Text -> Text Source #

A (quite possibly inefficient) re-implementation of git stripspace. This function normalizes a Text buffer to conform to the following rules:

  • All trailing white space is stripped.
  • Empty lines at the beginning or at the end of the buffer are stripped.
  • Consecutive empty lines between paragraphs are collapsed into one.
  • \r\n line endings are normalized into \n.
  • If the buffer is not empty, then its last line is terminated by \n.
  • If the buffer is empty (i.e. it contains only white space), then it comes out as the empty string.