diff --git a/Gruntfile.js b/Gruntfile.js index 54c041aa41..7d820e1075 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1031,7 +1031,7 @@ module.exports = function(grunt) { patterns: [ { match: /\/\/ START: emoji arrays[\S\s]*\/\/ END: emoji arrays/g, - replacement: function () { + replacement: function() { var regex, files, partials, partialsSet, entities, emojiArray; @@ -1057,7 +1057,7 @@ module.exports = function(grunt) { entities = entities.replace( /-/g, '' ); // Sort the entities list by length, so the longest emoji will be found first. - emojiArray = entities.split( '\n' ).sort( function ( a, b ) { + emojiArray = entities.split( '\n' ).sort( function( a, b ) { return b.length - a.length; } ); @@ -1097,6 +1097,26 @@ module.exports = function(grunt) { dest: SOURCE_DIR + 'wp-includes/' } ] + }, + emojiBannerText: { + options: { + patterns: [ + { + match: new RegExp( '\\s*' + BANNER_TEXT.replace( /[\/\*\!]/g, '\\$&' ) ), + replacement: '' + } + ] + }, + files: [ + { + expand: true, + flatten: true, + src: [ + BUILD_DIR + 'wp-includes/formatting.php' + ], + dest: BUILD_DIR + 'wp-includes/' + } + ] } }, _watch: { @@ -1419,6 +1439,7 @@ module.exports = function(grunt) { 'build:css', 'includes:emoji', 'includes:embed', + 'replace:emojiBannerText' ] ); } } );