xml-js
xml-js copied to clipboard
XML parse error when CDATA section contains <br> tag
I have a tag that holds plain text. It can have anything there, and I don't want to do any type of validation for it. But when I try to parse it I get an error
await xml2json('<job><![CDATA[<br>]]</job>', { spaces: 4, trim: true, });
Other "open" tags seems to be working ok(
for example)
<job><![CDATA[<br>]]></job>
Can be converted to json
{
"job": {
"#cdata-section": "<br>"
},
"#omit-xml-declaration": "yes"
}