Penar Musaraj 2018-10-07 22:32:25 -04:00 committed by Guo Xiang Tan
parent 43512e9865
commit 26956bbe1a
2 changed files with 9 additions and 0 deletions
lib/pretty_text
spec/components

@ -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