From 1b22efb2fddaf707f10c15e1a14f6ac50a80f083 Mon Sep 17 00:00:00 2001 From: Lukas Seyfarth Date: Tue, 2 Jul 2024 20:57:29 +0800 Subject: [PATCH] ignore option and select --- utils/translation/extractTextNodes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/translation/extractTextNodes.js b/utils/translation/extractTextNodes.js index 144489a..603a913 100644 --- a/utils/translation/extractTextNodes.js +++ b/utils/translation/extractTextNodes.js @@ -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;