Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simon/i26 emoji helper functions #56

Merged
merged 9 commits into from
May 7, 2024

Conversation

Simon-Laux
Copy link
Member

@Simon-Laux Simon-Laux commented Nov 16, 2023

  • add emoji parsing and a few helper functions
  • update changelog and readme
  • wasm api demo and readme
  • add two failing cases that I found while making the web demo

closes #26

TODO:

  • fix failing test cases

@Simon-Laux Simon-Laux marked this pull request as ready for review November 16, 2023 12:21
@Simon-Laux
Copy link
Member Author

What is this?

Basically provides helper functions for emoji parsing, which allow us:

  • to replace the regex in desktop (and maybe android) for detecting if an emoji message should be displayed bigger because it contains only a few emojis:(sometimes also called "jumbomoi"?)
    • iOS already has good system unicode emoji detection in swift
  • and the pr is a pre-requisite for other tasks such as
    • a mode where emojis are parsed into a dedicated element, useful for systems where unicode emoji font rendering is buggy (deltatouch, maybe also older android versions and kaiOS);
    • or another usecase could be for core to know what an emoji exactly is for example to allow emoji text avatars but not other avatars, which was a recent topic of a meeting, where bjoern and others proposed a default avatar.

src/parser/is_emoji.rs Show resolved Hide resolved
// region flags
recognize(tuple((
complete::char('🏴'),
many1(satisfy(|c| matches!(c, '\u{e0061}'..='\u{e007a}'))),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I guess a combination of many1 and satisfy is used instead of take_while1 to recognize characters instead of a string. right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes probably (though it is too long ago, so I don't remember every detail of the pr)

@Simon-Laux Simon-Laux force-pushed the simon/i26-emoji-helper-functions branch from 13a9955 to 1ff47c4 Compare May 7, 2024 11:06
@Simon-Laux Simon-Laux merged commit f010384 into master May 7, 2024
7 checks passed
@Simon-Laux Simon-Laux deleted the simon/i26-emoji-helper-functions branch May 7, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

idea: public method to get size of emoji-only message
2 participants