zaeleus/haste-server — comment on commit d87c3b7d61fb61cd5d0b1f2742257a7a1b749c33
File: static/application.js line 29
By zaeleus:

I think that answer is a bit excessive.

The [XML spec defines only five entities][1]: `amp`, `lt`, `gt`, `apos`, and `quot`. `'` is not a character entity in HTML, so [it is generally ignored][2] (see also [activesupport's ERB::Util#html_escape][3] and [PHP's htmlspecialchars][4], which both exclude single quote escaping by default). Characters like you pointed out are not necessary to escape, since they're just [aliases for Unicode characters][5].

[1]: http://www.w3.org/TR/REC-xml/#sec-predefined-ent
[2]: http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML
[3]: https://github.com/rails/rails/blob/3-2-stable/activesupport/lib/active_support/core_ext/string/output_safety.rb#L6
[4]: http://php.net/manual/en/function.htmlspecialchars.php
[5]: http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML