You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found src/misc is trying to strip emoji, HTML and any misc things in a text message.
I have 2 suggestions:
I feel a bit confused about all emoji rules and this file rules, so I suggest to add some comment here, then if any other one gets some new emoji rules, we can add it here.
I suggest to add two functions:
message.stripEmoji(): void: to strip emoji from the text message, then we can get a pure one.
message.emoji(): []: return a list containing all emojis meaning in the text.
I found the following code in src/misc seems trying to get emoji meaning but it cannot always succeed, also if there is some emotion, like gif in wechat, it doesn't work too.
Oh, thanks for spotting that, I was just about to write my own code to get rid of them.
When you say "some emotion ... doesn't work", can you give several sample of those not working emotions please?
Also, talking about cleaning up emoji, wouldn't clean = Misc.digestEmoji(messy) (or Misc.stripEmoji) be good enough? why proposing a different API? IMHO, I think we should have even fewer APIs, e.g., those people who prefer Misc.stripEmoji would most probably use stripHtml too, as it is hard to image someone want to get rid of only emoji while keeping other messy html stuff.
Personally, I'd use Misc.digestEmoji to keep the emojis, but I wouldn't use stripHtml blindly, as there are several useful HTML tags, like <br>, and a few others.
I found src/misc is trying to strip emoji, HTML and any misc things in a text message.
I have 2 suggestions:
I feel a bit confused about all emoji rules and this file rules, so I suggest to add some comment here, then if any other one gets some new emoji rules, we can add it here.
I suggest to add two functions:
message.stripEmoji(): void
: to strip emoji from the text message, then we can get a pure one.message.emoji(): []
: return a list containing all emojis meaning in the text.I found the following code in src/misc seems trying to get emoji meaning but it cannot always succeed, also if there is some emotion, like gif in wechat, it doesn't work too.
Well, thinks more, even it should be a seperate npm module....
The text was updated successfully, but these errors were encountered: