Skip to content

Commit

Permalink
fix node.tagName error
Browse files Browse the repository at this point in the history
  • Loading branch information
jemikanegara committed Sep 29, 2023
1 parent 607dcab commit 5762499
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ function getTranslationsFromAPI(strings, language, apiKey) {

function extractTextNodes(node, textNodes) {
if (!node) return;
if (node.tagName.toUpperCase() == "SCRIPT") return;
if (node.tagName.toUpperCase() == "SVG") return;
if (node.tagName.toUpperCase() == "PATH") return;
if (node.tagName.toUpperCase() == "CIRCLE") return;
if (node.tagName.toUpperCase() == "TEXTAREA") return;
if (node.tagName.toUpperCase() == "INPUT") return;
if (node.tagName.toUpperCase() == "STYLE") return;
if (node.tagName && node.tagName.toUpperCase() == "SCRIPT") return;
if (node.tagName && node.tagName.toUpperCase() == "SVG") return;
if (node.tagName && node.tagName.toUpperCase() == "PATH") return;
if (node.tagName && node.tagName.toUpperCase() == "CIRCLE") return;
if (node.tagName && node.tagName.toUpperCase() == "TEXTAREA") return;
if (node.tagName && node.tagName.toUpperCase() == "INPUT") return;
if (node.tagName && node.tagName.toUpperCase() == "STYLE") return;

if (node.nodeType === Node.TEXT_NODE) {
textNodes.push(node);
Expand Down

0 comments on commit 5762499

Please sign in to comment.