Skip to content
Permalink
Browse files

Emoji: Upgrade Twemoji to 12.1.2.

This upgrade adds support for the transgender flag: 🏳️‍⚧️

There's some additional housekeeping in this commit:

- Twemoji recently rearranged their repository and package, so `Gruntfile.js` needed tweaking to allow for that.
- As only new files were added in this Twemoji release, the CDN version didn't need updating.

Fixes #47852.



git-svn-id: https://develop.svn.wordpress.org/trunk@45769 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
pento committed Aug 8, 2019
1 parent 0d9ec05 commit c645936163a08db8f718dcb49ed50860b3cf3bb1
Showing with 78 additions and 20 deletions.
  1. +3 −3 Gruntfile.js
  2. +56 −14 package-lock.json
  3. +1 −1 package.json
  4. +16 −0 src/js/_enqueues/lib/emoji-loader.js
  5. +2 −2 src/wp-includes/formatting.php
@@ -173,7 +173,7 @@ module.exports = function(grunt) {
[ WORKING_DIR + 'wp-includes/js/jquery/jquery-migrate.min.js' ]: [ './node_modules/jquery-migrate/dist/jquery-migrate.min.js' ],
[ WORKING_DIR + 'wp-includes/js/jquery/jquery.form.js' ]: [ './node_modules/jquery-form/src/jquery.form.js' ],
[ WORKING_DIR + 'wp-includes/js/masonry.min.js' ]: [ './node_modules/masonry-layout/dist/masonry.pkgd.min.js' ],
[ WORKING_DIR + 'wp-includes/js/twemoji.js' ]: [ './node_modules/twemoji/2/twemoji.js' ],
[ WORKING_DIR + 'wp-includes/js/twemoji.js' ]: [ './node_modules/twemoji/dist/twemoji.js' ],
[ WORKING_DIR + 'wp-includes/js/underscore.js' ]: [ './node_modules/underscore/underscore.js' ],
},
{
@@ -1021,15 +1021,15 @@ module.exports = function(grunt) {
grunt.log.writeln( 'Fetching list of Twemoji files...' );

// Fetch a list of the files that Twemoji supplies
files = spawn( 'svn', [ 'ls', 'https://github.com/twitter/twemoji.git/branches/gh-pages/2/assets' ] );
files = spawn( 'svn', [ 'ls', 'https://github.com/twitter/twemoji.git/trunk/assets/svg' ] );
if ( 0 !== files.status ) {
grunt.fatal( 'Unable to fetch Twemoji file list' );
}

entities = files.stdout.toString();

// Tidy up the file list
entities = entities.replace( /\.ai/g, '' );
entities = entities.replace( /\.svg/g, '' );
entities = entities.replace( /^$/g, '' );

// Convert the emoji entities to HTML entities

Some generated files are not rendered by default. Learn more.

@@ -118,7 +118,7 @@
"polyfill-library": "3.27.4",
"react": "16.8.4",
"react-dom": "16.8.4",
"twemoji": "12.0.1",
"twemoji": "12.1.2",
"underscore": "1.8.3",
"whatwg-fetch": "3.0.0"
},
@@ -68,6 +68,22 @@

switch ( type ) {
case 'flag':
/*
* Test for Transgender flag compatibility. This flag is shortlisted for the Emoji 13 spec,
* but has landed in Twemoji early, so we can add support for it, too.
*
* To test for support, we try to render it, and compare the rendering to how it would look if
* the browser doesn't render it correctly (white flag emoji + transgender symbol).
*/
isIdentical = emojiSetsRenderIdentically(
[ 0x1F3F3, 0xFE0F, 0x200D, 0x26A7, 0xFE0F ],
[ 0x1F3F3, 0xFE0F, 0x200B, 0x26A7, 0xFE0F ]
);

if ( isIdentical ) {
return false;
}

/*
* Test for UN flag compatibility. This is the least supported of the letter locale flags,
* so gives us an easy test for full support.

Large diffs are not rendered by default.

0 comments on commit c645936

Please sign in to comment.
You can’t perform that action at this time.