-
Notifications
You must be signed in to change notification settings - Fork 13
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
Validate language tags, throwing errors if they aren't valid #24
Comments
Use the language tag regex from RDF (not the more strict one from BCP47). |
Turtle uses this
|
Note a PR exists for this on the jsonld.js side: It uses this: const LANG_RE = /^[a-zA-Z]+(-[a-zA-Z0-9]+)*$/; I still am concerned about merging that until we have performance hit benchmarks, probably a flag to disable all that checking (when you know you don't need it), and maybe an API for handling failures vs just dropping invalid data silently. Same issues if the check is in this lib. |
We should use BCP47 validation instead, not RDF, RDF will be getting errata/bug report. |
Those regexes are for capturing the various components of a language tag; we don't need any of that, we just need to know if it's valid. It should be a much simpler regex. |
No description provided.
The text was updated successfully, but these errors were encountered: