Skip to content
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

[Tiktok mentions] - parsing does not match tiktok mention behaviour #406

Open
RossCurry opened this issue Dec 5, 2023 · 2 comments
Open

Comments

@RossCurry
Copy link

RossCurry commented Dec 5, 2023

Users on the TIKTOK platform can include hyphens '-' in their nicknames. (possibly other characters)
As an example: user with nickname '---------'

Autolinker is following the available TIKTOK documentation for usernames (eventually used in a URL).

But TIKTOK, in their documentation for nicknames, don't mention any such restrictions.

I think its pretty logical to assume the same restrictions, however this is not the case.

The problem with all of this is that TIKTOK uses a users nickname for mentions. So mentions that include hyphens (and possibly more characters (hard to test, I can only change my nickname once a week) get cut short, and so the matchedText isn't correct.

Some more testing will have to be done, but I think eventually the REGEXP here for TIKTOK should be changed.

I'll try and test a bit more as soon as I can to determine exactly what characters are accepted for a nickname.

Update: i've since opened another 2 accounts with nicknames:
r@$$…€()44¥ & social hub spaces
I would say there are almost no restrictions to what a nickname can be.
So parsing text: 'Keep trying @social hub spaces' I got matchedText: '@social',

Possibly the white space is an edge case that would be impossible to cater for 🤷🏻

@RossCurry RossCurry changed the title [Tiktok mentions] - user nicknames on the tiktok platform can include hyphens '-' [Tiktok mentions] - parsing does not match tiktok mention behaviour Dec 5, 2023
@gregjacobs
Copy link
Owner

Hey Ross. Yeah, I don’t know how we could possibly support spaces for usernames. We couldn’t possibly know where to end the username in that case. For instance, if we had the string “check out @Someone on TikTok”, we wouldn’t be able to know to make the username “someone”, “someone on”, or “someone on TikTok”.

As far as adding hyphens goes, I think that’s a safe addition. I guess in theory we could also add every other non-whitespace character if TikTok is really that liberal in their username allowance!

@gregjacobs
Copy link
Owner

Feel free to submit a PR btw. Make sure to include tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants