function grabAllTextNodes()

in scripts/build.js [313:335]


      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;
      }