Safely embedding user content into a template
User comments, form responses, search queries — anything coming from outside that ends up inside a <p>, <li>, or attribute. Run through Minimal-mode encode before string-concatenating into your HTML, and you're safe from broken markup and the simplest XSS payloads.