Minor refactoring

Pass a RenderContext to escape and call context.settings().getBackslashEscapeHandling() only once.