HTML Entity 完了 List
Named および numeric 文字 リファレンス 用 HTML, 含む the five mandatory entities および 一般的 symbols.
Mandatory Entities
HTML defines five characters that must always be escaped when they appear in text content or attribute values to prevent parsing ambiguity. These entities avoid premature tag closure and attribute boundary confusion. Using them consistently prevents XSS injection points from forming in templates. Numeric references provide a fallback when named entities are unavailable in a given parser.
- &
- Ampersand, entity reference introducer
- <
- Less-than sign, tag opener
- >
- Greater-than sign, tag closer
- "
- Double quote, attribute delimiter
- '
- Apostrophe, single-quote attribute delimiter
& → & < → < > → > " → " ' → ' Numeric References
Numeric character references address any Unicode code point without relying on a named entity table. Decimal references use '&#' followed by the code point and a semicolon, while hexadecimal references use '&#x' with hex digits. Both forms resolve to the same character, but hex is more compact for large code points. Parsers must handle surrogate pairs correctly when the code point exceeds the BMP.
Common Symbol Entities
Beyond the mandatory five, many symbols have named entities for convenience in authoring. Mathematical operators, currency symbols, and typographic marks such as the non-breaking space and em dash are frequently encoded. The HTML5 specification lists over 2,000 named entities derived from SVG and MathML sets. Relying on named entities improves readability of source but numeric references are more portable across XML dialects.