xml-js icon indicating copy to clipboard operation
xml-js copied to clipboard

XML parse error when CDATA section contains <br> tag

Open jamaica474 opened this issue 4 years ago • 1 comments

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)

jamaica474 avatar Apr 26 '20 23:04 jamaica474

<job><![CDATA[<br>]]></job>

Can be converted to json

{
  "job": {
    "#cdata-section": "<br>"
  },
  "#omit-xml-declaration": "yes"
}

javadev avatar Apr 28 '23 22:04 javadev