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
Is html a language tag? #1
Comments
Currently, any sequence of letters, minimum two, will yield There are two ways to write this program. One is to concoct regex which matches existing variety of country codes: "at least two characters, optionally followed by a dash...". That's the easy way. The other way is to extract all the country codes known to humanity (ISO 3166 alpha-2?), then, at minimum, match the values without dashes against that list. Source: https://tools.ietf.org/html/rfc1766 |
PS. In the meantime, if anybody needs more strict language tag validation, I created a validator app based on a function, not regex, https://www.npmjs.com/package/is-language-code — it validates not only the values against known IANA tags but also evaluates the logic according the spec. The missing test |
(Shameless plug:) Maybe https://github.com/sozialhelden/ietf-language-tags might be interesting for more complex parsing and edge cases, too. Note that "language code" refers to different standards - there are differences between "IETF language tag", "Unicode language tag" and "POSIX language tag". |
Hi,
I'm quite surprised to see that the word
html
is considered as a language tag, i could not find any html language tag on the net so I post this issue.The text was updated successfully, but these errors were encountered: