Text content, quoted attributes, URLs, CSS, and JavaScript require different escaping
Encoding less-than and ampersand is important in HTML text. Quote handling depends on the attribute delimiter. Data inserted into a URL, style, or script needs the rules of that language as well. Do not apply one generic entity pass to mixed markup and assume every parser boundary is secure.