Skip to content

Commit

Permalink
ignore option and select
Browse files Browse the repository at this point in the history
  • Loading branch information
jemikanegara committed Jul 2, 2024
1 parent 55d2b5a commit 1b22efb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/translation/extractTextNodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ function assignFullTextToTextNodes(node, textNodes, topLevelTagName) {

function extractTextNodes(node, textNodes) {
if (!node) return;
if (node.tagName && ["SCRIPT", "SVG", "PATH", "CIRCLE", "TEXTAREA", "INPUT", "STYLE", "NOSCRIPT"].includes(node.tagName.toUpperCase())) return;
if (node.tagName && ["SCRIPT", "SVG", "PATH", "CIRCLE", "TEXTAREA", "INPUT", "SELECT", "OPTION", "STYLE", "NOSCRIPT"].includes(node.tagName.toUpperCase())) return;

if (node.nodeType === Node.TEXT_NODE) {
if (node.parentNode.tagName && ["SCRIPT", "SVG", "PATH", "CIRCLE", "TEXTAREA", "INPUT", "STYLE", "NOSCRIPT"].includes(node.parentNode.tagName.toUpperCase())) return;
if (node.parentNode.tagName && ["SCRIPT", "SVG", "PATH", "CIRCLE", "TEXTAREA", "INPUT", "SELECT", "OPTION", "STYLE", "NOSCRIPT"].includes(node.parentNode.tagName.toUpperCase())) return;


if(isUrl(node.textContent)) return;
Expand Down

0 comments on commit 1b22efb

Please sign in to comment.