mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Emoji: Replace twitter/twemoji with jdecked/twemoji.
After a chaotic change of ownership, the `twitter/twemoji` library is now considered abandoned. After waiting for this moment to arise, a fork was created by several former employees who had maintained the library which lives at `jdecked/twemoji` on GitHub. This switches out where the underlying source code comes from for the library, and applies the 15.0.3 update, which adheres to the Unicode 15 spec and adds support for all Emoji introduced in Emoji 15.0. This does not update the underlying `precommit:emoji` Grunt script responsible for updating `formatting.php`. After GitHub recently sunset support for SVN, the current process needs to be replaced with a new one. This will be handled in #60520. Let the masses rejoice for the 🐦⬛ singing in the dead of night, secure 🛜, aromatic 🫚, and some very silly 🪿🪿. RIP Twemoji. Long live Twemoji! Props peterwilsoncc, kraftbj, jeffpaul, azaozz, dd32, hareesh-pillai, jorbin. Fixes #57600. git-svn-id: https://develop.svn.wordpress.org/trunk@57626 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -232,27 +232,24 @@
|
||||
return ! isIdentical;
|
||||
case 'emoji':
|
||||
/*
|
||||
* Why can't we be friends? Everyone can now shake hands in emoji, regardless of skin tone!
|
||||
* Four and twenty blackbirds baked in a pie.
|
||||
*
|
||||
* To test for Emoji 14.0 support, try to render a new emoji: Handshake: Light Skin Tone, Dark Skin Tone.
|
||||
* To test for Emoji 15.0 support, try to render a new emoji: Blackbird.
|
||||
*
|
||||
* The Handshake: Light Skin Tone, Dark Skin Tone emoji is a ZWJ sequence combining 🫱 Rightwards Hand,
|
||||
* 🏻 Light Skin Tone, a Zero Width Joiner, 🫲 Leftwards Hand, and 🏿 Dark Skin Tone.
|
||||
* The Blackbird is a ZWJ sequence combining 🐦 Bird and ⬛ large black square.,
|
||||
*
|
||||
* 0x1FAF1 == Rightwards Hand
|
||||
* 0x1F3FB == Light Skin Tone
|
||||
* 0x1F426 (\uD83D\uDC26) == Bird
|
||||
* 0x200D == Zero-Width Joiner (ZWJ) that links the code points for the new emoji or
|
||||
* 0x200B == Zero-Width Space (ZWS) that is rendered for clients not supporting the new emoji.
|
||||
* 0x1FAF2 == Leftwards Hand
|
||||
* 0x1F3FF == Dark Skin Tone.
|
||||
* 0x2B1B == Large Black Square
|
||||
*
|
||||
* When updating this test for future Emoji releases, ensure that individual emoji that make up the
|
||||
* sequence come from older emoji standards.
|
||||
*/
|
||||
isIdentical = emojiSetsRenderIdentically(
|
||||
context,
|
||||
'\uD83E\uDEF1\uD83C\uDFFB\u200D\uD83E\uDEF2\uD83C\uDFFF', // as the zero-width joiner sequence
|
||||
'\uD83E\uDEF1\uD83C\uDFFB\u200B\uD83E\uDEF2\uD83C\uDFFF' // separated by a zero-width space
|
||||
'\uD83D\uDC26\u200D\u2B1B', // as the zero-width joiner sequence
|
||||
'\uD83D\uDC26\u200B\u2B1B' // separated by a zero-width space
|
||||
);
|
||||
|
||||
return ! isIdentical;
|
||||
|
||||
13
src/js/_enqueues/vendor/twemoji.js
vendored
13
src/js/_enqueues/vendor/twemoji.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -6,8 +6,8 @@
|
||||
*/
|
||||
class Tests_Formatting_Emoji extends WP_UnitTestCase {
|
||||
|
||||
private $png_cdn = 'https://s.w.org/images/core/emoji/14.0.0/72x72/';
|
||||
private $svn_cdn = 'https://s.w.org/images/core/emoji/14.0.0/svg/';
|
||||
private $png_cdn = 'https://s.w.org/images/core/emoji/15.0.3/72x72/';
|
||||
private $svn_cdn = 'https://s.w.org/images/core/emoji/15.0.3/svg/';
|
||||
|
||||
/**
|
||||
* @ticket 36525
|
||||
@@ -80,15 +80,20 @@ class Tests_Formatting_Emoji extends WP_UnitTestCase {
|
||||
*/
|
||||
public function test_wp_emoji_list_returns_data() {
|
||||
$default = _wp_emoji_list();
|
||||
$this->assertNotEmpty( $default );
|
||||
$this->assertNotEmpty( $default, 'Default should not be empty' );
|
||||
|
||||
$entities = _wp_emoji_list( 'entities' );
|
||||
$this->assertNotEmpty( $entities );
|
||||
|
||||
$this->assertSame( $default, $entities );
|
||||
$this->assertNotEmpty( $entities, 'Entities should not be empty' );
|
||||
$this->assertIsArray( $entities, 'Entities should be an array' );
|
||||
// Emoji 15 contains 3718 entities, this number will only increase.
|
||||
$this->assertGreaterThanOrEqual( 3718, count( $entities ), 'Entities should contain at least 3718 items' );
|
||||
$this->assertSame( $default, $entities, 'Entities should be returned by default' );
|
||||
|
||||
$partials = _wp_emoji_list( 'partials' );
|
||||
$this->assertNotEmpty( $partials );
|
||||
$this->assertNotEmpty( $partials, 'Partials should not be empty' );
|
||||
$this->assertIsArray( $partials, 'Partials should be an array' );
|
||||
// Emoji 15 contains 1424 partials, this number will only increase.
|
||||
$this->assertGreaterThanOrEqual( 1424, count( $partials ), 'Partials should contain at least 1424 items' );
|
||||
|
||||
$this->assertNotSame( $default, $partials );
|
||||
}
|
||||
@@ -106,9 +111,9 @@ class Tests_Formatting_Emoji extends WP_UnitTestCase {
|
||||
'🙂',
|
||||
),
|
||||
array(
|
||||
// Skin tone, gender, ZWJ, emoji selector.
|
||||
'👮🏼♀️',
|
||||
'👮🏼‍♀️',
|
||||
// Bird, ZWJ, black large squre, emoji selector.
|
||||
'🐦⬛',
|
||||
'🐦‍⬛',
|
||||
),
|
||||
array(
|
||||
// Unicode 10.
|
||||
|
||||
Reference in New Issue
Block a user