Developer releases browser-based HTML entity encoder supporting all three encoding formats
A developer has built a browser-only HTML entity encoder and decoder that supports named, decimal, and hexadecimal encoding formats without requiring a server or external framework. The tool covers 253 HTML5 named entities spanning Latin, Greek, math, currency, and symbol character sets, and decodes all three entity formats in a single regex pass. It handles Unicode code points correctly, including emoji and characters outside the Basic Multilingual Plane, avoiding errors common in index-based string iteration. The implementation includes a prototype-pollution guard during named entity lookups and accepts both lowercase and uppercase hex prefixes as permitted by the HTML5 specification. The tool is available as a single offline-capable HTML file and was validated against 246 automated tests.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in