Skip to main content
The Collapse Whitespace action shortens runs of spaces and line breaks to configurable maximums. Use it to clean copied text without removing all paragraph structure.
The source filename intentionally uses collpase-whitespace. The action shown in the workflow builder is named Collapse Whitespace.

Inputs

Outputs

How the limits work

Only runs longer than the configured maximum are changed. With the defaults:
  • Two or more consecutive spaces become one space.
  • Three or more consecutive line breaks become two line breaks.
  • Tabs and other whitespace are left unchanged.
  • Windows-style \r\n line breaks are normalized to \n only when a run is collapsed.
Set a maximum to 0 to remove matching runs entirely. Turn either collapse toggle off to preserve that kind of whitespace regardless of its maximum.
Use Trim Whitespace after this action if leading or trailing whitespace should also be removed.