globalseo
Advanced tools
Comparing version 2.1.49 to 2.1.50
14
index.js
@@ -390,6 +390,14 @@ const { isBrowser, getGlobalseoOptions, setGlobalseoOptions, setGlobalseoActiveLang, setIsTranslationInitialized, getIsTranslationInitialized, shouldTranslateInlineText, getGlobalseoActiveLang, DEFAULT_UNTRANSLATED_VALUE, MERGE_PREFIX, SPECIAL_API_KEYS } = require('./utils/configs.js'); | ||
return new Promise(async (resolve) => { | ||
// Remove empty strings | ||
// Remove empty strings & unmatched context | ||
const cleanTextNodes = textNodes.filter( | ||
(textNode) => | ||
typeof textNode.textContent == "string" && !!textNode.textContent.trim() | ||
(textNode) => { | ||
const trimmed = (typeof textNode.textContent === "string" && textNode.textContent.trim()) || ""; | ||
const isNotEmpty = !!trimmed; | ||
const isTextContentIsInContext = textNode.context && typeof textNode.context == 'string' ? | ||
textNode.context.includes(trimmed) : | ||
true; | ||
return isNotEmpty && isTextContentIsInContext; | ||
} | ||
); | ||
@@ -396,0 +404,0 @@ |
{ | ||
"name": "globalseo", | ||
"version": "2.1.49", | ||
"version": "2.1.50", | ||
"description": "Translate your React.js or Next.js app with AI", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
485808
3065