Hacker News new | past | comments | ask | show | jobs | submit login

Sort of related, could anyone please explain why there is a , named character reference in the HTML standard?

https://html.spec.whatwg.org/multipage/named-characters.html...




The now deprecated FONT FACE attribute was defined as a comma-separated list of names. The entity was needed if you had a font name with a comma in it.

Another comma-separated list is in the TH|TD AXIS attribute which is considered obsolete now. I found two other CSL attributes in APPLET ARCHIVE (depr.) and AREA COORDS but neither of them need a comma entity.

So the comma entity exists only as a historical artifact.


Couldn't you use , instead?


Perhaps for usage as an escaped form of `,` in comma separated value tables? Although good question why it's in the HTML spec, pasting raw csv inside of an element and then needing to read it back seems like a rare use case.


Why not? There's lots of named characters in the range of 0x20-0x2F, and symbols in general.


Those symbols (including comma) were added in later editions of the standard, and I'm sure there's a reason, but it seems to me if your keyboard has the characters & and ; it will also have , no? I mean, why not add &a; for a then?


There's also ";" standing for ";", which makes even less sense to me.


To escape both special characters if you wanted to display ";" to the user?


In order to encode the ; as a character, when ; is being used as a separator.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: