- Use markupsafe to format escaped HTML fragments - Correct the formatting problems introduced with the XSS fixes