From 16a6fbe7a1198fb04fe00e16fc1d89a1abd83d48 Mon Sep 17 00:00:00 2001 From: Lukas Seyfarth Date: Mon, 24 Jun 2024 16:13:36 +0800 Subject: [PATCH] wrap plain textnode in span --- 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 812ccc2..4d1938c 100644 --- a/utils/translation/extractTextNodes.js +++ b/utils/translation/extractTextNodes.js @@ -233,9 +233,9 @@ function extractTextNodes(node, textNodes) { const textNodesForContextWithCurrentNode = [...leftTextNodes, singleTextNode, ...rightTextNodes]; const context = textNodesForContextWithCurrentNode.reduce((acc, textNode) => { - // if has sibling, then dont inject tag name + // if has sibling, then inject span (for splitting purpose on backend) if (textNode.parentNode.childNodes.length > 1) { - return `${acc} ${textNode.textContent}`; + return `${acc} ${textNode.textContent}`; } else { return `${acc} <${textNode.parentNode.tagName.toLowerCase()}>${textNode.textContent}`; }