logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: 334a446313d504ef9bb80ce213be32729aa3d2b8
parent: ecacb15cd50609fb3d749ecac89835a43255fb34
Author: Nolan Lawson <nolan@nolanlawson.com>
Date:   Tue,  3 Oct 2017 04:11:22 -0700

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

Fixes #5188

Diffstat:

Mpackage.json2+-
Mspec/javascript/components/emojify.test.js5+++++
Myarn.lock6+++---
3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/package.json b/package.json @@ -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", diff --git a/spec/javascript/components/emojify.test.js b/spec/javascript/components/emojify.test.js @@ -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" />'); + }); }); diff --git a/yarn.lock b/yarn.lock @@ -6581,9 +6581,9 @@ style-loader@^0.18.2: loader-utils "^1.0.2" schema-utils "^0.3.0" -substring-trie@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/substring-trie/-/substring-trie-1.0.1.tgz#1a5f07f774a91524eb067cb318dd4f3a3037bee0" +substring-trie@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/substring-trie/-/substring-trie-1.0.2.tgz#7b42592391628b4f2cb17365c6cce4257c7b7af5" sugarss@^1.0.0: version "1.0.0"