simplifying escaping of newlines so it only happens in text escaping