-
Notifications
You must be signed in to change notification settings - Fork 22
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
chore(emoji): Fix issue where numbers and some symbols got big_emoji class applied #1469
Conversation
Walkthrough# Walkthrough
The changes primarily focus on the `markdown` function in `kit/src/components/message/mod.rs`. A temporary workaround has been introduced to handle certain characters that were mistakenly identified as emojis. The function now checks for specific characters and alphanumeric sequences before applying the emoji formatting. The logic for handling emojis has also been adjusted.
# Changes
| File | Change Summary |
| --- | --- |
| `kit/src/components/message/mod.rs` | Introduced a temporary workaround for certain characters mistakenly identified as emojis. The `markdown` function now checks for specific characters and alphanumeric sequences before applying the emoji formatting. The logic for handling emojis has been adjusted. |
# Assessment against linked issues (Beta)
| Objective | Addressed | Explanation |
| --- | --- | --- |
| Identify and fix the bug causing the font size to increase when numbers are sent in the chat (#1468) | ✅ | |
| Ensure that the font size remains consistent regardless of the content of the message (text, numbers, symbols, etc.) (#1468) | ✅ | |
| Understand the goal of the GitHub issue, which is to create a proof of concept for integrating Tailwind CSS with Rust (#001) | ❌ | The changes in this PR do not pertain to the integration of Tailwind CSS with Rust. |
| Analyze the process of running `make tailwind`, which should identify any classes defined in Rust files and include them in the generated stylesheet (#001) | ❌ | The changes in this PR do not pertain to the `make tailwind` process. |
| Identify the technical requirements and constraints for this integration, including any necessary dependencies or configurations (#001) | ❌ | The changes in this PR do not pertain to the technical requirements and constraints for integrating Tailwind CSS with Rust. | TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: .coderabbit.yaml
Files selected for processing (1)
- kit/src/components/message/mod.rs (1 hunks)
Additional comments: 2
kit/src/components/message/mod.rs (2)
452-452: The comment provides a link to the issue in the
rust-unic
repository. This is good practice as it provides context for the workaround and allows developers to track the progress of the issue.458-461: The code returns a formatted string with the appropriate span class based on the checks. This is a good use of the
format!
macro to create a string with embedded values.
6ad5946
to
e56882d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UI Automated Tests execution is complete! You can find the test results report here |
847663e
to
00f4649
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5a15811
to
540b420
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 2
Configuration used: .coderabbit.yaml
Files selected for processing (1)
- kit/src/components/message/mod.rs (1 hunks)
Additional comments: 2
kit/src/components/message/mod.rs (2)
- 450-461: The code is returning HTML directly from the function. This could potentially lead to XSS (Cross-Site Scripting) vulnerabilities if
r
contains any user-supplied input. Consider using a safe method to escape any potential HTML inr
before returning it.return format!("<span class=\"big-emoji\">{}</span>", html_escape::encode_text(&r));
- 453-456: The workaround checks for specific characters and alphanumeric sequences. Ensure that this workaround does not interfere with the normal functioning of the chat feature and that it correctly identifies all emojis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coderabbit is very wrong regarding this PR. lol
@WanderingHogan On all OS's this seems to break markdowns |
0edc449
to
285b437
Compare
@phillsatellite i think it is ready to try again, sorry about that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What this PR does 📖
This is a workaround for the big numbers in chat, if you send them by themselves.
We rely on this crate: https://crates.io/crates/unic-emoji-char/0.8.0
That crate has this bug: open-i18n/rust-unic#280
numbers and some symbols (like # and *) trigger the emoji checks from that crate.
Which issue(s) this PR fixes 🔨
Special notes for reviewers 🗒️
Additional comments 🎤