-
-
Notifications
You must be signed in to change notification settings - Fork 88
Customize special characters to encode? #100
Copy link
Copy link
Open
Description
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 :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels