Skip to content

refactor: emoji detection in text#961

Open
hazre wants to merge 1 commit into
devfrom
hazre/feat/emoji-detection-refactor
Open

refactor: emoji detection in text#961
hazre wants to merge 1 commit into
devfrom
hazre/feat/emoji-detection-refactor

Conversation

@hazre

@hazre hazre commented Jun 18, 2026

Copy link
Copy Markdown
Member

Description

cherry pick from #607

which I didn't totally forgot to add to #950 🥴

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

AI disclosure:

  • Partially AI assisted (clarify which code was AI assisted and briefly explain what it does).
  • Fully AI generated (explain what all the generated code does in moderate detail).

tl;dr instead shipping a massive unicode regex, we can rely on grapheme regex's provided by unicode standard which is in all browsers. If you wanna read on it, just look up the reg vars here: https://www.unicode.org/reports/tr51/
It's deliberately more loose to be able to handle new emojis without problem.

The rest of it is dealing with multi character emojis and displaying it properly, which I used Intl.Segmenter to do that.

So instead of seeing this:

image

You would see this instead:

image

@hazre hazre requested a review from 7w1 as a code owner June 18, 2026 02:24
@hazre hazre added the internal label Jun 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

Status Preview URL Commit Alias Updated (UTC)
✅ Deployment successful! https://pr-961-sable.raspy-dream-bb1d.workers.dev b59c927 pr-961 Thu, 18 Jun 2026 02:26:23 GMT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant