isaacs / sax-js

A sax style parser for JS
Other
1.09k stars 325 forks source link

Attributes in root element not parsing #250

Open inexas opened 2 years ago

inexas commented 2 years ago

This seems an unlikely bug but I can't get it to work... If I try and parse the following

<x a="A"></x>

I get: ERROR: Error: Unexpected end Line: 0 Column: 8 Char: "

That is it complains about the closing quote. If I take out the attribute or put it in a child element, everything works fine. E.g. "<y><x a="A"></x></y>" parses OK.

Thx for the hard work BTW