Adds proper escaping of newline chars