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

Incorrect error message for unknown named character references #51

Open
youming-lin opened this issue Oct 13, 2016 · 3 comments
Open

Incorrect error message for unknown named character references #51

youming-lin opened this issue Oct 13, 2016 · 3 comments

Comments

@youming-lin
Copy link

A minor issue:

he.decode('&abc;', {strict: true}) throws error with this message: Parse error: named character reference was not terminated by a semicolon, when in fact neither a nor ab are valid legacy named character references and &abc; is terminated by ;. I think an error message to the effect of Parse error: named character reference is not spec-defined would be better in this case.

This and #50 notwithstanding, he has been a great companion to the HTML5 spec as I learn about and write a spec-compliant HTML entity decoder for Swift :)

@mathiasbynens
Copy link
Owner

Another excellent report. Thank you, @youming-lin!

Will your decoder be open-source?

@youming-lin
Copy link
Author

@mathiasbynens Yup, it is Apache 2.0 licensed: https://github.com/IBM-Swift/swift-html-entities

Version 1 supports HTML4 named character references; I'm currently working on version 2 which will support HTML5 named character references and improve parsing to detect parse errors as defined in the spec.

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

3 participants
@mathiasbynens @youming-lin and others