Emoji: better regex when testing for only char emoji. Props iseulde. See #31242.

Built from https://develop.svn.wordpress.org/trunk@31772


git-svn-id: http://core.svn.wordpress.org/trunk@31752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2015-03-13 20:27:26 +00:00
parent ac90f66250
commit c8129335b5
3 changed files with 6 additions and 4 deletions

View File

@ -102,7 +102,7 @@ window.wp = window.wp || {};
}
/*
* Chrome OS X added native emoji rendering in M41. Unfortunately,
* Chrome on OS X added native emoji rendering in M41. Unfortunately,
* it doesn't work when the font is bolder than 500 weight. So, we
* check for bold rendering support to avoid invisible emoji in Chrome.
*/
@ -174,7 +174,9 @@ window.wp = window.wp || {};
return false;
}
if ( emoji.parseFlags && ! emoji.parseAllEmoji && ! icon.match( /^1f1(e[6-9a-f]|f[1-9a-f])-1f1(e[6-9a-f]|f[1-9a-f])$/ ) ) {
if ( emoji.parseFlags && ! emoji.parseAllEmoji &&
! /^1f1(?:e[6-9a-f]|f[1-9a-f])-1f1(?:e[6-9a-f]|f[1-9a-f])$/.test( icon ) ) {
return false;
}

View File

@ -1 +1 @@
window.wp=window.wp||{},function(a,b,c,d){var e=a.MutationObserver||a.WebKitMutationObserver||a.MozMutationObserver,f={parseAllEmoji:!1,parseEmoji:!1,parseFlags:!1,init:function(){f.parseAllEmoji=!f.browserSupportsEmoji(),f.parseFlags=!f.browserSupportsFlagEmoji(),f.parseEmoji=f.parseAllEmoji||f.parseFlags,a.addEventListener?a.addEventListener("load",f.load,!1):a.attachEvent&&a.attachEvent("onload",f.load)},load:function(){e&&new e(function(a){for(var b,c,d=a.length;d--;)for(b=a[d].addedNodes.length;b--;)c=a[d].addedNodes[b],3===c.nodeType&&(c=c.parentNode),c&&1===c.nodeType&&f.parse(c)}).observe(document.body,{childList:!0,subtree:!0}),f.parse(document.body)},browserSupportsEmoji:function(){var a=document.createElement("canvas"),b=a.getContext&&a.getContext("2d");return b&&b.fillText?(b.textBaseline="top",b.font="600 32px Arial",b.fillText(String.fromCharCode(55357,56835),0,0),0!==b.getImageData(16,16,1,1).data[0]):!1},browserSupportsFlagEmoji:function(){var a=document.createElement("canvas"),b=a.getContext&&a.getContext("2d");return b&&b.fillText?(b.textBaseline="top",b.font="32px Arial",b.fillText(String.fromCharCode(55356,56812,55356,56807),0,0),a.toDataURL().length>3e3):!1},parse:function(a){return f.parseEmoji?c.parse(a,{base:d.baseUrl,ext:d.ext,callback:function(a,b){switch(a){case"a9":case"ae":case"2122":case"2194":case"2660":case"2663":case"2665":case"2666":return!1}return!f.parseFlags||f.parseAllEmoji||a.match(/^1f1(e[6-9a-f]|f[1-9a-f])-1f1(e[6-9a-f]|f[1-9a-f])$/)?"".concat(b.base,"/",a,b.ext):!1}}):a}};f.init(),b.emoji=f}(window,window.wp,window.twemoji,window._wpemojiSettings);
window.wp=window.wp||{},function(a,b,c,d){var e=a.MutationObserver||a.WebKitMutationObserver||a.MozMutationObserver,f={parseAllEmoji:!1,parseEmoji:!1,parseFlags:!1,init:function(){f.parseAllEmoji=!f.browserSupportsEmoji(),f.parseFlags=!f.browserSupportsFlagEmoji(),f.parseEmoji=f.parseAllEmoji||f.parseFlags,a.addEventListener?a.addEventListener("load",f.load,!1):a.attachEvent&&a.attachEvent("onload",f.load)},load:function(){e&&new e(function(a){for(var b,c,d=a.length;d--;)for(b=a[d].addedNodes.length;b--;)c=a[d].addedNodes[b],3===c.nodeType&&(c=c.parentNode),c&&1===c.nodeType&&f.parse(c)}).observe(document.body,{childList:!0,subtree:!0}),f.parse(document.body)},browserSupportsEmoji:function(){var a=document.createElement("canvas"),b=a.getContext&&a.getContext("2d");return b&&b.fillText?(b.textBaseline="top",b.font="600 32px Arial",b.fillText(String.fromCharCode(55357,56835),0,0),0!==b.getImageData(16,16,1,1).data[0]):!1},browserSupportsFlagEmoji:function(){var a=document.createElement("canvas"),b=a.getContext&&a.getContext("2d");return b&&b.fillText?(b.textBaseline="top",b.font="32px Arial",b.fillText(String.fromCharCode(55356,56812,55356,56807),0,0),a.toDataURL().length>3e3):!1},parse:function(a){return f.parseEmoji?c.parse(a,{base:d.baseUrl,ext:d.ext,callback:function(a,b){switch(a){case"a9":case"ae":case"2122":case"2194":case"2660":case"2663":case"2665":case"2666":return!1}return!f.parseFlags||f.parseAllEmoji||/^1f1(?:e[6-9a-f]|f[1-9a-f])-1f1(?:e[6-9a-f]|f[1-9a-f])$/.test(a)?"".concat(b.base,"/",a,b.ext):!1}}):a}};f.init(),b.emoji=f}(window,window.wp,window.twemoji,window._wpemojiSettings);

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-beta1-31771';
$wp_version = '4.2-beta1-31772';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.