Display an HTML example safely
Encode tag characters so documentation shows the markup literally.
Convert HTML-sensitive characters to named, decimal, or hexadecimal entities and decode entities with the browser table.
Encode tag characters so documentation shows the markup literally.
Restore copied HTML entity strings to readable characters.
HTML entity conversion uses browser string and DOM features.