twitter / twitter-text

Twitter Text Libraries. This code is used at Twitter to tokenize and parse text to meet the expectations for what can be used on the platform.
https://developer.twitter.com/en/docs/counting-characters
Apache License 2.0
3.07k stars 520 forks source link

Parsing TwitterTextEntityScreenName fails #339

Open Kyome22 opened 3 years ago

Kyome22 commented 3 years ago

Describe the bug If the user enters an Emoji with a number in a box such as 1️⃣ without any space after the screenName starting with @, the screenName parsing fails.

To Reproduce Steps to reproduce the behavior:

  1. Go to tweetdeck.twitter.com and open the text field for a new tweet.
  2. Type @hello1️⃣ and post the tweet.
  3. Check the tweet in the timeline.
  4. See the garbled text like the attached image. Screen Shot 2021-01-26 at 23 33 27

Expected behavior The screenName is parsed correctly and the text is not garbled.

Environment I see this phenomenon when using TweetDeck in Chrome for macOS.

Additional context This problem also exists in the Objective-C implementation of twitter-text.