Agree with attribute values being stored as-is.

If you feel the above solution is not viable, perhaps introduce a new option of whether attribute values should be encoded or not (or also go through the decode > encode cycle) when rendering HTML, because they could come in either way.

It would be naive to expect HTML input to come in a certain way, because as we all know, there is HTML as a spec, and all the randomness that occurs in the real world.