HTML Magic Symbols

just realized html characters like:

& 

will also be recognized by the browser WITHOUT

 ; 

I had a problem because of this:

 &current 

has been replaced by

 ยคt 

You can clarify - why?

+4
source share
3 answers

Some character symbol names, for backward compatibility reasons, are recognized without the need for an end semicolon. ¤ is one of them.

Here is a complete list of named character names, which shows those that don't need a semicolon: https://www.w3.org/TR/html51/syntax.html#named-character-references

+2
source

Because any & in HTML should be encoded as & . This way, any & on its own will be interpreted as the beginning of the HTML object, and browsers will try to correct the error (the parser may try to interpret the object if the character is out of range, such as a space character).

Whenever you use & in your HTML, encode it as & .

+3
source

Browsers try hard to sort out the trash whenever they can. There is no rule saying that they should do this or what they need, or even that it is a good idea. But if some browsers do this, then they just do it.

+1
source

All Articles