ytt icon indicating copy to clipboard operation
ytt copied to clipboard

Add an optional boolean to not escape html during json encoding

Open WnP opened this issue 1 year ago • 9 comments

Fix #890

WnP avatar Jan 29 '24 16:01 WnP

checking. one comment about boolean flag, can we also explore if we can pass additional parameters to the json.encode() method. (just a thought I am not sure if it is feasible to do).

prembhaskal avatar Jan 30 '24 05:01 prembhaskal

one comment about boolean flag, can we also explore if we can pass additional parameters to the json.encode() method. (just a thought I am not sure if it is feasible to do).

There's no other option on the json Encoder, only SetIndent and SetEscapeHTML.

Okhoshi avatar Jan 30 '24 06:01 Okhoshi

I've fixed the tests and created one for the new feature.

WnP avatar Jan 30 '24 09:01 WnP

one comment about boolean flag, can we also explore if we can pass additional parameters to the json.encode() method. (just a thought I am not sure if it is feasible to do).

There's no other option on the json Encoder, only SetIndent and SetEscapeHTML.

ignore my previous comment, I think I had a brain fade moment there.

I feel it is better to name the variable as escape_html with the default value as true, which will be inline with what json encoder is doing.

someone intending to not escape html can set it as escape_html=false

prembhaskal avatar Jan 30 '24 14:01 prembhaskal

@cppforlife @100mik please have a look at this when you get time.

prembhaskal avatar Feb 01 '24 05:02 prembhaskal

@WnP also could you please check the lint failure when you get time. meanwhile I will try to get our approvers eyes on the review.

prembhaskal avatar Feb 07 '24 15:02 prembhaskal

Sorry for the delay @prembhaskal, I was quite busy during the last days.

Feel free to ping me if there's something missing.

WnP avatar Feb 08 '24 14:02 WnP

LGTM, @cppforlife please review when you get time.

prembhaskal avatar Feb 09 '24 05:02 prembhaskal

LGTM!

sethiyash avatar Feb 27 '24 11:02 sethiyash