diff --git a/src/wp-includes/js/wp-emoji.js b/src/wp-includes/js/wp-emoji.js index 4331bbd562..3b1a211be0 100644 --- a/src/wp-includes/js/wp-emoji.js +++ b/src/wp-includes/js/wp-emoji.js @@ -70,11 +70,13 @@ node = node.parentNode; } - if ( ! node || ( node.className && node.className.indexOf( 'wp-exclude-emoji' ) !== -1 ) ) { + if ( ! node || node.nodeType !== 1 || ( 'ownerSVGElement' in node ) || + ( node.className && typeof node.className === 'string' && node.className.indexOf( 'wp-exclude-emoji' ) !== -1 ) ) { + continue; } - if ( node.nodeType === 1 && test( node.textContent ) ) { + if ( test( node.textContent ) ) { parse( node ); } }