Emoji: make sure we parse only strings or DOM nodes that have children.
Props peterwilsoncc. Fixes #32300. git-svn-id: https://develop.svn.wordpress.org/trunk@32679 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b513402c28
commit
194d266afb
@ -120,7 +120,9 @@
|
||||
* @param {Object} args Additional options for Twemoji.
|
||||
*/
|
||||
function parse( object, args ) {
|
||||
if ( ! replaceEmoji || ! twemoji ) {
|
||||
if ( ! replaceEmoji || ! twemoji || ! object ||
|
||||
( 'string' !== typeof object && ( ! object.childNodes || ! object.childNodes.length ) ) ) {
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user