diff --git a/2/twemoji.js b/2/twemoji.js index 067969b4..ea071732 100644 --- a/2/twemoji.js +++ b/2/twemoji.js @@ -516,6 +516,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}; } @@ -564,4 +572,4 @@ var twemoji = (function ( return r.join(sep || '-'); } -}()); \ No newline at end of file +}());