Reputation: 5279
I have been using slim, and suddenly noticed that it escapes everything by default. So the anchor tag looks something like this:
<a href="/users/lyann/followers">
<img class="user-image" src="http://adasdasdasd.cloudfront.net/users&# 47;2011/05/24/4asdasd/asdasd.jpg" />
Is it okay for the href
and src
attributes to be escaped like this? Are there any other implications? All browsers seems to render it without a problem, though.
Upvotes: 11
Views: 4346
Reputation:
Yes, it's perfectly fine. Character references are valid inside attributes, too, and will be treated as character references just the same.
For reference, see:
Upvotes: 8