Friday, July 13th, 2007

&less than

Friday, July 13th, 2007 03:59 pm
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
When it's not followed by a letter or number, &lt can be interpreted by browsers in the same way as &lt;. That is, < and < should both show up as less than symbols (check the source if you want to confirm). So if you leave out the semi-colon and just type &lt, it will still show up as a < as long as you don't do anything funny like follow it with a non-whitespace character (or will it work with certain other punctuation marks as well?)

It shows up this way on normal webpages, but not in comment notifications viewed in Gmail.

I can't tell whether it's a Gmail thing or an HTML cleaner thing. (Actually, for once I don't really care enough to test further. I'm just amused because I spent a few hours testing, only to have [livejournal.com profile] aveleh forward me a link to a document in w3c stating that this is, indeed, proper behavior.)

ETA:
</fake html tag> (with &lt;) should work properly. I just remembered, because it was a comment like this that sent me investigating in the first place.