Home > other >  Are there some valid HTML entities without the semicolon?
Are there some valid HTML entities without the semicolon?

Time:10-04

Looking at this official entities.json file, some of the entities are defined without an ending semicolon.

For example:

"&Acirc": { "codepoints": [194], "characters": "\u00C2" },
"Â": { "codepoints": [194], "characters": "\u00C2" },

Where is that documented in HTML5? Or is that a browser thing¹?

¹ thing as in extension for backward compatibility.

CodePudding user response:

HTML named character list is defined at https://html.spec.whatwg.org/multipage/named-characters.html and yes, some of these don't have a trailing ; e.g &not

&not

CodePudding user response:

I made a program in python to get some numbers, and I found out that:

In the 2231 total entities, there are 4.75% or 106 valid entities without a semi-colon at end

All those entities:

&AElig, &AMP, &Aacute, &Acirc, &Agrave, &Aring, &Atilde, &Auml, &COPY, &Ccedil, &ETH, &Eacute, &Ecirc, &Egrave, &Euml, &GT, &Iacute, &Icirc, &Igrave, &Iuml, &LT, &Ntilde, &Oacute, &Ocirc, &Ograve, &Oslash, &Otilde, &Ouml, &QUOT, &REG, &THORN, &Uacute, &Ucirc, &Ugrave, &Uuml, &Yacute, &aacute, &acirc, &acute, &aelig, &agrave, &amp, &aring, &atilde, &auml, &brvbar, &ccedil, &cedil, &cent, &copy, &curren, &deg, &divide, &eacute, &ecirc, &egrave, &eth, &euml, &frac12, &frac14, &frac34, &gt, &iacute, &icirc, &iexcl, &igrave, &iquest, &iuml, &laquo, &lt, &macr, &micro, &middot, &nbsp, &not, &ntilde, &oacute, &ocirc, &ograve, &ordf, &ordm, &oslash, &otilde, &ouml, &para, &plusmn, &pound, &quot, &raquo, &reg, &sect, &shy, &sup1, &sup2, &sup3, &szlig, &thorn, &times, &uacute, &ucirc, &ugrave, &uml, &uuml, &yacute, &yen, &yuml

  • Related