diff --git a/src/js/_enqueues/wp/emoji.js b/src/js/_enqueues/wp/emoji.js
index b2c8e1a15a..8ab5ea945e 100644
a
|
b
|
|
121 | 121 | while ( ii-- ) { |
122 | 122 | node = addedNodes[ ii ]; |
123 | 123 | |
| 124 | // Don't replace emoji inside elements that don't support it. |
| 125 | if ( ! node || node.closest( '.wp-exclude-emoji' ) || node.closest( '.CodeMirror' ) ) { |
| 126 | continue; |
| 127 | } |
| 128 | |
124 | 129 | // Node type 3 is a TEXT_NODE. |
125 | 130 | if ( node.nodeType === 3 ) { |
126 | 131 | if ( ! node.parentNode ) { |
… |
… |
|
145 | 150 | node = node.parentNode; |
146 | 151 | } |
147 | 152 | |
148 | | /* |
149 | | * If the class name of a non-element node contains 'wp-exclude-emoji' ignore it. |
150 | | * |
151 | | * Node type 1 is an ELEMENT_NODE. |
152 | | */ |
153 | | if ( ! node || node.nodeType !== 1 || |
154 | | ( node.className && typeof node.className === 'string' && node.className.indexOf( 'wp-exclude-emoji' ) !== -1 ) ) { |
155 | | |
| 153 | // Only make replacements inside Element nodes. |
| 154 | if ( node.nodeType !== 1 ) { |
156 | 155 | continue; |
157 | 156 | } |
158 | 157 | |