replace newlines with spaces on mapper output