holtwick / zeed-dom

🌱 Lightweight offline DOM
MIT License
33 stars 5 forks source link

Fix infinite loop in `HtmlParser` #9

Closed estrattonbailey closed 10 months ago

estrattonbailey commented 10 months ago

We're integrating Tiptap, which relies on this library, and noticed that trying to generateJSON from a text fragment << results in an infinite loop which crashes the browser.

This PR fixes what I think is a small bug, where the string slicing was off-by-one due to the substring(1) call.

holtwick commented 10 months ago

Thank you very much for fixing this bug. I'll do a new release after testing.

estrattonbailey commented 10 months ago

@holtwick thanks for the quick turnaround! We really appreciate it :)