We have a use case where we'd like to write JSON into HTML attributes, and we'd like to use html-entities to do this safely.
One problem is that encoding JSON makes it very hard to read since all quotes are encoded.
<div data-user="{"name":"Conan O'Brien","age":99}"></div>
If we could skip decoding the double quote...
<div data-user='{"name":"Conan O'Brien","age":99}'></div>
Do you think a change to customize the regexp of encoded characters makes sense? Alternatively, you could convince me that this is a bad idea :)
We have a use case where we'd like to write JSON into HTML attributes, and we'd like to use html-entities to do this safely.
One problem is that encoding JSON makes it very hard to read since all quotes are encoded.
If we could skip decoding the double quote...
Do you think a change to customize the regexp of encoded characters makes sense? Alternatively, you could convince me that this is a bad idea :)