rhysd/remark-emoji

things that should not become emojis are becoming them

Opened this issue · 3 comments

I think this fixes it:

const RE_SHORT = /(?<=\s|^)[@$|*'",;.=:-)([]\/<>038BOopPsSdDxXzZ]{2,5}(?=\s|$|[.?!,])/g;

and then a test of:

image

all existing tests pass with that change.

@rhysd do you think this is the right solution?

It's worth noting that look behind regular expressions aren't supported in iOS < 16.4. That's 18 months old, but it looks like there's still a decent user base where this could just blow up. I'm going to try using XRegExp* to patch that for now. I figure the support will only continue to increase, making it a moot point in ~a year or so.