diff --git a/2/twemoji.js b/2/twemoji.js index a1bf9c5f..73d68083 100644 --- a/2/twemoji.js +++ b/2/twemoji.js @@ -515,6 +515,14 @@ var twemoji = (function ( } function parse(what, how) { + // first argument can only be string or HTML Element + if ( + typeof what !== 'string' && + !(what && what.nodeName) + ) { + return what; + } + if (!how || typeof how === 'function') { how = {callback: how}; } @@ -563,4 +571,4 @@ var twemoji = (function ( return r.join(sep || '-'); } -}()); \ No newline at end of file +}());