Emoji: do not try to replace emoji chars inside SVGs.

Fixes #32305 for 4.2.
Built from https://develop.svn.wordpress.org/branches/4.2@33312


git-svn-id: http://core.svn.wordpress.org/branches/4.2@33284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2015-07-17 20:17:27 +00:00
parent 0300e1f14a
commit 72a321196e
3 changed files with 8 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -70,13 +70,13 @@
node = node.parentNode;
}
if ( ! node || ( node.className && node.className.indexOf( 'wp-exclude-emoji' ) !== -1 ) ) {
continue;
}
if ( ! node || node.nodeType !== 1 || ( 'ownerSVGElement' in node ) ||
( node.className && typeof node.className === 'string' && node.className.indexOf( 'wp-exclude-emoji' ) !== -1 ) ) {
if ( node && node.nodeType === 1 ) {
parse( node );
}
continue;
}
parse( node );
}
}
} ).observe( document.body, {

View File

@ -1 +1 @@
!function(a,b){function c(){function c(){if(!i){if("undefined"==typeof a.twemoji){if(j>600)return;return a.clearTimeout(f),f=a.setTimeout(c,50),void j++}e=a.twemoji,i=!0,g&&new g(function(a){for(var b,c,e,f,g=a.length;g--;){if(b=a[g].addedNodes,c=a[g].removedNodes,e=b.length,1===e&&1===c.length&&3===b[0].nodeType&&"IMG"===c[0].nodeName&&b[0].data===c[0].alt)return;for(;e--;)f=b[e],3===f.nodeType&&(f=f.parentNode),!f||f.className&&-1!==f.className.indexOf("wp-exclude-emoji")||f&&1===f.nodeType&&d(f)}}).observe(document.body,{childList:!0,subtree:!0}),d(document.body)}}function d(a,c){return h&&e?(c=c||{},e.parse(a,{base:b.baseUrl,ext:b.ext,className:c.className||"emoji",imgAttr:c.imgAttr,callback:function(a,c){switch(a){case"a9":case"ae":case"2122":case"2194":case"2660":case"2663":case"2665":case"2666":return!1}return b.supports.flag||!b.supports.simple||/^1f1(?:e[6-9a-f]|f[0-9a-f])-1f1(?:e[6-9a-f]|f[0-9a-f])$/.test(a)?"".concat(c.base,a,c.ext):!1}})):a}var e,f,g=a.MutationObserver||a.WebKitMutationObserver||a.MozMutationObserver,h=!1,i=!1,j=0;return b&&(h=!b.supports.simple||!b.supports.flag,b.DOMReady?c():b.readyCallback=c),{replaceEmoji:h,parse:d}}a.wp=a.wp||{},a.wp.emoji=new c}(window,window._wpemojiSettings);
!function(a,b){function c(){function c(){if(!i){if("undefined"==typeof a.twemoji){if(j>600)return;return a.clearTimeout(f),f=a.setTimeout(c,50),void j++}e=a.twemoji,i=!0,g&&new g(function(a){for(var b,c,e,f,g=a.length;g--;){if(b=a[g].addedNodes,c=a[g].removedNodes,e=b.length,1===e&&1===c.length&&3===b[0].nodeType&&"IMG"===c[0].nodeName&&b[0].data===c[0].alt)return;for(;e--;)f=b[e],3===f.nodeType&&(f=f.parentNode),!f||1!==f.nodeType||"ownerSVGElement"in f||f.className&&"string"==typeof f.className&&-1!==f.className.indexOf("wp-exclude-emoji")||d(f)}}).observe(document.body,{childList:!0,subtree:!0}),d(document.body)}}function d(a,c){return h&&e?(c=c||{},e.parse(a,{base:b.baseUrl,ext:b.ext,className:c.className||"emoji",imgAttr:c.imgAttr,callback:function(a,c){switch(a){case"a9":case"ae":case"2122":case"2194":case"2660":case"2663":case"2665":case"2666":return!1}return b.supports.flag||!b.supports.simple||/^1f1(?:e[6-9a-f]|f[0-9a-f])-1f1(?:e[6-9a-f]|f[0-9a-f])$/.test(a)?"".concat(c.base,a,c.ext):!1}})):a}var e,f,g=a.MutationObserver||a.WebKitMutationObserver||a.MozMutationObserver,h=!1,i=!1,j=0;return b&&(h=!b.supports.simple||!b.supports.flag,b.DOMReady?c():b.readyCallback=c),{replaceEmoji:h,parse:d}}a.wp=a.wp||{},a.wp.emoji=new c}(window,window._wpemojiSettings);