Notes: This is a comparison of the conversion from string->attribute set that happens inside of the inspector tab when modifying an attribute. The proposed parsing uses the DOM to handle conversion of string to attributes. Potentially could have security issues, but there is Components.interfaces.nsIScriptableUnescapeHTML that should do the same thing.
Here the thing I am talking about:
Red = Proposed Parsing
Blue = Current Parsing