Browse Source

Fix emoji sequence bug in substring-trie (#5191)

Fixes #5188
pull/4/head
Nolan Lawson 5 years ago
committed by Eugen Rochko
parent
commit
334a446313
3 changed files with 9 additions and 4 deletions
  1. +1
    -1
      package.json
  2. +5
    -0
      spec/javascript/components/emojify.test.js
  3. +3
    -3
      yarn.lock

+ 1
- 1
package.json View File

@ -104,7 +104,7 @@
"sass-loader": "^6.0.6",
"stringz": "^0.2.2",
"style-loader": "^0.18.2",
"substring-trie": "^1.0.1",
"substring-trie": "^1.0.2",
"throng": "^4.0.0",
"tiny-queue": "^0.2.1",
"uuid": "^3.1.0",

+ 5
- 0
spec/javascript/components/emojify.test.js View File

@ -44,4 +44,9 @@ describe('emojify', () => {
it('ignores unicode inside of tags', () => {
expect(emojify('<p data-foo="\uD83D\uDC69\uD83D\uDC69\uD83D\uDC66"></p>')).to.equal('<p data-foo="\uD83D\uDC69\uD83D\uDC69\uD83D\uDC66"></p>');
});
it('does multiple emoji properly (issue 5188)', () => {
expect(emojify('👌🌈💕')).to.equal('<img draggable="false" class="emojione" alt="👌" title=":ok_hand:" src="/emoji/1f44c.svg" /><img draggable="false" class="emojione" alt="🌈" title=":rainbow:" src="/emoji/1f308.svg" /><img draggable="false" class="emojione" alt="💕" title=":two_hearts:" src="/emoji/1f495.svg" />');
expect(emojify('👌 🌈 💕')).to.equal('<img draggable="false" class="emojione" alt="👌" title=":ok_hand:" src="/emoji/1f44c.svg" /> <img draggable="false" class="emojione" alt="🌈" title=":rainbow:" src="/emoji/1f308.svg" /> <img draggable="false" class="emojione" alt="💕" title=":two_hearts:" src="/emoji/1f495.svg" />');
});
});

+ 3
- 3
yarn.lock View File

@ -6581,9 +6581,9 @@ [email protected]^0.18.2:
loader-utils "^1.0.2"
schema-utils "^0.3.0"
[email protected]^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/substring-trie/-/substring-trie-1.0.1.tgz#1a5f07f774a91524eb067cb318dd4f3a3037bee0"
[email protected]^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/substring-trie/-/substring-trie-1.0.2.tgz#7b42592391628b4f2cb17365c6cce4257c7b7af5"
[email protected]^1.0.0:
version "1.0.0"

Loading…
Cancel
Save