Reputation: 696
just realized that html symbols like:
&
will be also recognized by browser WITHOUT
;
I had problem because of that:
¤t
was replaced with
¤t
can you clarify - why?
Upvotes: 4
Views: 411
Reputation: 83051
Some named character references are, for backward compatibility reasons, recognised without needing a trailing semicolon. ¤
is one of them.
A full list of named character references, which shows those that don't need a trailing semicolon is given here: https://www.w3.org/TR/html51/syntax.html#named-character-references
Upvotes: 2
Reputation: 490481
Because any &
in HTML should be encoded as &
. So any &
on its own will be interpreted as the start of a HTML entity and browsers attempt error correction (the parser may attempt to interpret the entity if a character falls outside of its allowable sequence, such as the space character).
Whenever you use a &
in your HTML, encode it as &
.
Upvotes: 3
Reputation: 81724
Browsers try hard to make sense of garbage when they can. There's no rule that says they should do this, or that they have to, or even that it's a good idea. But if some browsers do this, then they just do.
Upvotes: 1