Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing a non-breaking space as an attribute name raises a runtime error #10

Closed
magopian opened this issue Apr 9, 2019 · 1 comment
Closed

Comments

@magopian
Copy link
Contributor

magopian commented Apr 9, 2019

Disclaimer: I believe the bug is in the compiler (see elm/html#46 and elm/html#47).

As it's likely not going to be fixed (for performance reasons), I guess it makes sense to fix it in this library.

To reproduce, try parsing and rendering something like <img \u{00a0} /> (example in this Ellie), and there will be a runtime error in the console: InvalidCharacterError: String contains an invalid character.

At least in some cases, this results in an infinite loop of rendering/runtime errors, which brings the browser (and the whole computer) to its knees.

@hecrj
Copy link
Owner

hecrj commented Apr 9, 2019

I see! Thanks for the detailed report and the fix! 🎉 🎉

@hecrj hecrj closed this as completed in 8022add Apr 9, 2019
hecrj added a commit that referenced this issue Apr 9, 2019
magopian added a commit to magopian/rerss-elm-ui that referenced this issue Apr 9, 2019
This new version has a fix for the "non-breaking space of doom": hecrj/html-parser#10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants