Skip to content
Permalink
Browse files

Emoji: Revert [46393] pending test failure investigation.

See #46537.

git-svn-id: https://develop.svn.wordpress.org/trunk@46397 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
SergeyBiryukov committed Oct 5, 2019
1 parent 0200a42 commit c3c0007121da0e121cf95d97d911375fbb3c601d
Showing with 8 additions and 7 deletions.
  1. +8 −7 src/js/_enqueues/wp/emoji.js
@@ -121,11 +121,6 @@
while ( ii-- ) {
node = addedNodes[ ii ];

// Don't replace emoji inside elements that don't support it.
if ( ! node || node.closest( '.wp-exclude-emoji' ) || node.closest( '.CodeMirror' ) ) {
continue;
}

// Node type 3 is a TEXT_NODE.
if ( node.nodeType === 3 ) {
if ( ! node.parentNode ) {
@@ -150,8 +145,14 @@
node = node.parentNode;
}

// Only make replacements inside Element nodes.
if ( node.nodeType !== 1 ) {
/*
* If the class name of a non-element node contains 'wp-exclude-emoji' ignore it.
*
* Node type 1 is an ELEMENT_NODE.
*/
if ( ! node || node.nodeType !== 1 ||
( node.className && typeof node.className === 'string' && node.className.indexOf( 'wp-exclude-emoji' ) !== -1 ) ) {

continue;
}

0 comments on commit c3c0007

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