Replace newlines with spaces so they don't cause an error.