lowlighter / libs

🍱 Collection of carefully crafted TypeScript standalone libraries. Minimal, unbloated, convenient.
https://jsr.io/@libs
MIT License
120 stars 11 forks source link

fix: prevent hanging when the first character is invalid #31

Closed Leokuma closed 1 year ago

Leokuma commented 1 year ago

Fixes #28

Apparently, when the very first character of the XML was different from <, parsing would fall into an infinite loop. I'm not sure if anything other than the first character could cause the same issue.

Let me know if we can throw a better error message.