You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
this might be a weird usecase but, for a request inspector UI i am building and "htmlized" output of the responses, not only for some simple styling but also for interactive purposes. The result is then appended to a dom node. A simplified version can be described as bellow
The package still works, but keys are being treated as required for "quotify" probably due the special html chars used. Is it out of scope of the package to include a condition to strip quotes from htmlized keys?
At the moment i'm striping quotes with some regex but not sure how battle tested this is and therefore if something like this could be included. Also other beautifiers output the same result as yours so i expect that this might not be trivial.
Thanks for the package anyways,
Keep shipping
The text was updated successfully, but these errors were encountered:
It wouldn't strip quotes as stringify-object is the one adding the quotes. We could have an option to just not quote object keys, but what if the key is foo bar? I assume you would want <span>"foo bar"</span>: and not <span>foo bar</span>:, as the latter is invalid JS when the HTML is rendered. So leaving out the quotes is not a good way to solve this problem.
We could potentially add a hook that lets you wrap certain things like object keys.
Hey, a lot went on after this, sry for the delay.
So yes your assumptions are correct.
I think it's safe to close this issue, as this seem to be an edge case specific derived from a UI decision on the project i was workin on and not relevant feature for the package purpose anyways. If i recall it correctly, i did the risky regex thing after the stringify process, since it was particular case, not a generic thing.
Hello!
this might be a weird usecase but, for a request inspector UI i am building and "htmlized" output of the responses, not only for some simple styling but also for interactive purposes. The result is then appended to a dom node. A simplified version can be described as bellow
The package still works, but keys are being treated as required for "quotify" probably due the special html chars used. Is it out of scope of the package to include a condition to strip quotes from htmlized keys?
At the moment i'm striping quotes with some regex but not sure how battle tested this is and therefore if something like this could be included. Also other beautifiers output the same result as yours so i expect that this might not be trivial.
Thanks for the package anyways,
Keep shipping
The text was updated successfully, but these errors were encountered: