Skip to content
Snippets Groups Projects
Commit f49339ca authored by Ondřej Hruška's avatar Ondřej Hruška Committed by Eugen Rochko
Browse files

Fix multipoint shortcode bug (#4387)

* Fix multipoint shortcode bug

* Added testcase for composite emoji shortcode
parent 994d948c
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ class Emoji
def codepoint_to_unicode(codepoint)
if codepoint.include?('-')
codepoint.split('-').map(&:hex).pack('U')
codepoint.split('-').map(&:hex).pack('U*')
else
[codepoint.hex].pack('U')
end
......
......@@ -7,6 +7,11 @@ RSpec.describe EmojiHelper, type: :helper do
expect(emojify(text)).to eq '📖 Book'
end
it 'converts composite emoji shortcodes to unicode' do
text = ':couple_ww:'
expect(emojify(text)).to eq '👩❤👩'
end
it 'does not convert shortcodes that are part of a string into unicode' do
text = ':see_no_evil::hear_no_evil::speak_no_evil:'
expect(emojify(text)).to eq text
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment