I think the modification of the map can be removed. This is to encode all the [named character references](http://www.w3.org/TR/html5/syntax.html#named-character-references) rather than doing some limited escaping.