mirror of
https://github.com/discourse/discourse.git
synced 2025-03-22 13:26:40 +08:00
FIX: Safari issue with some emojis (#6456)
https://meta.discourse.org/t/emojis-selected-on-ios-displaying-additional-rectangles/86132/8
This commit is contained in:
parent
43512e9865
commit
26956bbe1a
@ -20,6 +20,11 @@ __setUnicode = function(replacements) {
|
||||
}
|
||||
text = text.replace(m[0], replacement);
|
||||
}
|
||||
|
||||
// fixes Safari VARIATION SELECTOR-16 issue with some emojis
|
||||
// https://meta.discourse.org/t/emojis-selected-on-ios-displaying-additional-rectangles/86132
|
||||
text = text.replace(/\ufe0f/g, '');
|
||||
|
||||
return text;
|
||||
};
|
||||
};
|
||||
|
@ -797,6 +797,10 @@ describe PrettyText do
|
||||
expect(PrettyText.cook("hello 👩🏾🎓")).to eq("<p>hello <img src=\"/images/emoji/twitter/woman_student/5.png?v=#{Emoji::EMOJI_VERSION}\" title=\":woman_student:t5:\" class=\"emoji\" alt=\":woman_student:t5:\"></p>")
|
||||
expect(PrettyText.cook("hello 🤷♀️")).to eq("<p>hello <img src=\"/images/emoji/twitter/woman_shrugging.png?v=#{Emoji::EMOJI_VERSION}\" title=\":woman_shrugging:\" class=\"emoji\" alt=\":woman_shrugging:\"></p>")
|
||||
end
|
||||
|
||||
it "correctly strips VARIATION SELECTOR-16 character (ufe0f) from some emojis" do
|
||||
expect(PrettyText.cook("❤️💣")).to match(/<img src[^>]+bomb[^>]+>/)
|
||||
end
|
||||
end
|
||||
|
||||
describe "custom emoji" do
|
||||
|
Loading…
x
Reference in New Issue
Block a user