Closed qxtaiba closed 4 years ago
Hi, Thanks for your feedback. Yeah it definitely makes sense to support emojis inside hashtags and mentions. Fix is already released in v4.9.9 Enjoy :)
Hey! I just tried running your latest commit, although it still isn't recognizing hashtags with emojis as hashtags. I tested this by adding a breakpoint and when there is an emoji at the end, the hashtag case is never triggered.
I tried creating a PR with a fix that worked for me but I don't have access to this repository.
If you simply replace return detect(regex: "[#]\\w\\S*\\b")
with return detect(regex: "[#]\\S+")
then you'll find that emojis are detected as part of the tag.
Hm, you likely not running latest commit (v4.9.9). In latest version regex was modified as follows:
public func detectHashTags() -> [Range<String.Index>] {
return detect(regex: "#[^[:punct:][:space:]]+")
}
public func detectMentions() -> [Range<String.Index>] {
return detect(regex: "@[^[:punct:][:space:]]+")
}
FYI you don't need access to repo to create PR. Check this guide https://www.freecodecamp.org/news/how-to-make-your-first-pull-request-on-github-3/
I'm currently working with Atributika and my use-case specifically applies to the hashtag functionality. I have noticed that the parser doesn't seem to include emojis in the tag and I was wondering if any of you have a fix/workaround for this?
To just give you all an example, let's say the hashtag I'm working with is #Atributika❤️, but the parser will only parse up to #Atributika and ignores the emoji.