-
-
Notifications
You must be signed in to change notification settings - Fork 334
Validator: Fix name regexp #205
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
Conversation
|
Please check my latest commit |
It solves the issues I found. Thank you! Can you please release a new version so we can use it? I'm still not sure why you need localeRange. Both XML and JSON support unicode characters in names. Why don't you just allow any supported unicode the spec defines? It can be converted both ways. |
Yes, you're right. We can allow that. But in this case we'll have to remove |
Done. Please review. |
You're so quick. Thanks. Let me check. As this will be a change in the API, I'll have to publish it with minor version change. I'll try to do that ASAP. |
Please also update the Readme and release notes. |
I'll try to review the changes tomorrow morning :) Thanks for your effort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check my comments. We can probably simplify the logic and add unit test to cross verify it.
@orgads are you still on this? |
c74c513
to
7f4881b
Compare
I removed localeRange from README.md and index.html, but did not remove it from parser.d.ts in order to not break existing code that uses it. |
Changes in |
Replace the regexp with one that matches the XML spec[1] (except [\u10000-\uEFFFF] which matches digits for some reason...). Remove the localeRange option, which is no longer needed [1] https://www.w3.org/TR/xml/#NT-NameStartChar
The failed checks are false positives. |
Sorry for the delay. But I'm unable to take any action for next few weeks. Will update you. And thanks for your effort. |
I have cross verified for the performance. It looks fine. Let me check for other aspects. I'll update you if there is any issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regex needs to be checked again. It'll change the position of captured text as well. But since any test didn't fail because of this, we can add a possible test to fail it with current regex and then pass for updated regex.
Purpose / Goal
Validator: Fix name regexp
The previous implementation only allowed the "localeRange" for the first character, and it did not validate the following characters at all, because the regexp did not include $, so if the first character
matched, the regexp would match.
Replace the regexp with one that matches the XML spec (except [\u10000-\uEFFFF] which matches digits for some reason...) and match all the characters.
Remove the localeRange option, which is no longer needed
Type
Please mention the type of PR