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

feat: include text preceeding special case emojis, include ™ symbol in excluded emojis #2502

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/layout/src/text/emoji.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const fetchEmojis = (string, source) => {
return promises;
};

const specialCases = ['©️', '®']; // Do not treat these as emojis if emoji not present
const specialCases = ['©️', '®', '™']; // Do not treat these as emojis if emoji not present

export const embedEmojis = fragments => {
const result = [];
Expand Down Expand Up @@ -101,7 +101,7 @@ export const embedEmojis = fragments => {
},
});
} else if (isSpecialCase) {
result.push({ string: emoji, attributes: fragment.attributes });
result.push({ string: chunk, attributes: fragment.attributes });
} else {
// If no emoji data, we just replace the emoji with a nodef char
result.push({
Expand Down