document: Make replace_spacing collapse newlines