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

Fixes #5188
This commit is contained in:
Nolan Lawson 2017-10-03 04:11:22 -07:00 committed by Eugen Rochko
parent ecacb15cd5
commit 334a446313
3 changed files with 9 additions and 4 deletions

View file

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

View file

@ -44,4 +44,9 @@ describe('emojify', () => {
it('ignores unicode inside of tags', () => { 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>'); 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" />');
});
}); });

View file

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