We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When article name is a UTF-8 string or contains some UTF-8 characters,
gajus.contents.id(articleName)
will return a empty string, which leads to the Error('Invalid ID.')
My temporary solution: Implement the function contents.formatId like below
contents.formatId = function (str) { if (!str.match(/^[a-z]+[a-z0-9\-_:\.]*$/)) { return "hash" + str.hashCode(); } };
Then gajus/contents works perfectly.
PS: The implementation of str.hashCode()
String.prototype.hashCode = function () { var hash = 0, i, chr, len; if (this.length == 0) return hash; for (i = 0, len = this.length; i < len; i++) { chr = this.charCodeAt(i); hash = ((hash << 5) - hash) + chr; hash |= 0; // Convert to 32bit integer } return hash; };
The text was updated successfully, but these errors were encountered:
fix gajus#11
f9fedf1
gajus
No branches or pull requests
When article name is a UTF-8 string or contains some UTF-8 characters,
will return a empty string, which leads to the Error('Invalid ID.')
My temporary solution:
Implement the function contents.formatId like below
Then gajus/contents works perfectly.
PS:
The implementation of str.hashCode()
The text was updated successfully, but these errors were encountered: