-
Notifications
You must be signed in to change notification settings - Fork 255
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
Trailing dash in urls being dropped in sms - some android devices #96
Comments
Happened to see the same issue today. As a quick fix I'm going to use |
@irfaan yeah, some (if not all) of Android devices drop tilde too. I'm currently doing a brute force way of generating shortid repeatedly till I get one that doesn't end with a special character. Not at all the best way but I was running out of time to dig into it. And can't have broken URLs sent to users! |
var shortid = require('shortid')
var shortidNotEndWithSpecialCharacter = function () {
var id
do {
id = shortid.generate();
}
while(id[0] === '-' || id[0] === '_' || id.slice(-1) === '-' || id.slice(-1) === '_');
return id;
} |
Removing IDS with last |
We saw the same issue with |
Change alphabet by: shortid.characters('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~_') Or use Nano ID which use |
@ai happens with tilde (~), too: #96 (comment) |
Just a PSA - I have noticed that, when texting a url with a trailing dash, some android devices are dropping the trailing dash when parsing urls in text messages. It seems to only happen when text follows a url with a trailing dash.
The text was updated successfully, but these errors were encountered: