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

xml to js is not converting empty comments

Open bobharley opened this issue 6 years ago • 1 comments

sample xml:

   <test><!----></test>

output:

{
  "elements": [
    {
      "type": "element",
      "name": "test-child"
    }
  ]
}

expected output:

{
  "elements": [
    {
      "type": "element",
      "name": "test-child",
      "elements": [
        {
          "type": "comment",
          "comment": ""
        }
      ]
    }
  ]
}

Is there an option to do this?

bobharley avatar Jun 07 '18 07:06 bobharley

Also on empty cdata

<![CDATA[]]>

returns {}

bobharley avatar Jun 12 '18 01:06 bobharley