function grabAllTextNodes(node, allText) {
        var
          childNodes = node.childNodes,
          length = childNodes.length,
          subnode,
          nodeType;
        while (length--) {
          subnode = childNodes[length];
          nodeType = subnode.nodeType;
          // parse emoji only in text nodes
          if (nodeType === 3) {
            // collect them to process emoji later
            allText.push(subnode);
          }
          // ignore all nodes that are not type 1, that are svg, or that
          // should not be parsed as script, style, and others
          else if (nodeType === 1 && !('ownerSVGElement' in subnode) &&
              !shouldntBeParsed.test(subnode.nodeName.toLowerCase())) {
            grabAllTextNodes(subnode, allText);
          }
        }
        return allText;
      }
/**
       * Given a generic DOM nodeType 1, walk through all children
       * and store every nodeType 3 (#text) found in the tree.
       * @param   Element a DOM Element with probably some text in it
       * @param   Array the list of previously discovered text nodes
       * @return  Array same list with new discovered nodes, if any
       */
Given a generic DOM nodeType 1, walk through all children
and store every nodeType 3 (#text) found in the tree.
@param   Element a DOM Element with probably some text in it
@param   Array the list of previously discovered text nodes
@return  Array same list with new discovered nodes, if any
Given a generic DOM nodeType 1 walk through all children and store every nodeType 3 ( #text ) found in the tree . @param Element a DOM Element with probably some text in it @param Array the list of previously discovered text nodes @return Array same list with new discovered nodes if any
function grabAllTextNodes(node, allText) {
        var
          childNodes = node.childNodes,
          length = childNodes.length,
          subnode,
          nodeType;
        while (length--) {
          subnode = childNodes[length];
          nodeType = subnode.nodeType;
          if (nodeType === 3) {
            allText.push(subnode);
          }
          else if (nodeType === 1 && !('ownerSVGElement' in subnode) &&
              !shouldntBeParsed.test(subnode.nodeName.toLowerCase())) {
            grabAllTextNodes(subnode, allText);
          }
        }
        return allText;
      }
function grabAllTextNodes ( node , allText ) { var childNodes = node . childNodes , length = childNodes . length , subnode , nodeType ; while ( length -- ) { subnode = childNodes [ length ] ; nodeType = subnode . nodeType ; if ( nodeType === 3 ) { allText . push ( subnode ) ; } else if ( nodeType === 1 && ! ( 'ownerSVGElement' in subnode ) && ! shouldntBeParsed . test ( subnode . nodeName . toLowerCase ( ) ) ) { grabAllTextNodes ( subnode , allText ) ; } } return allText ; }
Given a generic DOM nodeType 1, walk through all children
 and store every nodeType 3 (#text) found in the tree.
Given a generic DOM nodeType 1 walk through all children and store every nodeType 3 ( #text ) found in the tree .
// parse emoji only in text nodes // collect them to process emoji later // ignore all nodes that are not type 1, that are svg, or that // should not be parsed as script, style, and others