Open anhuet opened 11 months ago
@anhuet
The sanitize
options can ignore this behavior, but it has been deprecated.
The follow code can help you:
const res = convert.json2xml(
JSON.stringify({
value: [
{
_text: '"test < "',
},
],
}),
{
compact: true,
textFn: (value) => {
return value.replace("<", "<");
},
}
);
// <value>"test < "</value>
console.log(res);
I'm using json2xml
Here is test.json file
Result:
<value>"test < "</value>
Expect:
<value>"test < "</value>
Is there any way to ignore auto convert < to <