Escape output all at once instead of using piecewise escaping