segmentio / xml-parser

simple non-compliant xml parser for nodejs
101 stars 36 forks source link

Not handling mixed content correctly #21

Open chrisbottin opened 7 years ago

chrisbottin commented 7 years ago

Given the following example: <a>foo <b>bar <c>baz</c></b>bad</a>

Issue: The text "bad" is lost when parsed.

The actual output is:

{ 
  declaration: undefined,
  root: 
  { 
     name: 'a',
     attributes: {},
     children: 
      [ 
         {
             name: 'b',
              attributes: {},
              children: [ { name: 'c', attributes: {}, children: [], content: 'baz' } ],
              content: 'bar ' 
         } 
     ],
     content: 'foo ' } 
}
chrisbottin commented 7 years ago

Any chance this could be supported soon?

I wanted to use your library but I'm facing this blocker.