Display an HTML fragment as text
Example input
<b>A & B</b>Expected result
<b>A & B</b>Encode the sample to protect the angle brackets and ampersand. A browser reading that encoded text in an HTML text context displays the fragment rather than making it bold. Decoding reverses the representation. If you insert the decoded result as HTML elsewhere, its markup becomes active again, so inspect the destination's rendering behavior.