Skip to content

Commit

Permalink
check for list item
Browse files Browse the repository at this point in the history
  • Loading branch information
jemikanegara committed May 27, 2024
1 parent 2d13b5b commit 732b927
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 @@ -105,7 +105,7 @@ function extractTextNodes(node, textNodes) {
(child.childNodes || []).forEach((grandChild) => {
if (grandChild instanceof Element && window.getComputedStyle(grandChild).display === 'inline') {
inlineChildren.push(grandChild);
if (grandChild.tagName === 'A' || grandChild.tagName === 'BUTTON') {
if (grandChild.tagName === 'A' || grandChild.tagName === 'BUTTON' || grandChild.tagName === 'LI') {
childrenTags.push(grandChild);
}
}
Expand All @@ -130,7 +130,7 @@ function extractTextNodes(node, textNodes) {

// check if all parent siblings are links or buttons
const isAllParentSiblingsAreLinksOrButtons = parentSiblings.every((child) => {
return child instanceof Element && (child.tagName === 'A' || child.tagName === 'BUTTON');
return child instanceof Element && (child.tagName === 'A' || child.tagName === 'BUTTON' || child.tagName === "LI");
});

if (parentSiblings.length > 1 && shouldAssignFullText && !isAllParentSiblingsAreLinksOrButtons) {
Expand Down

0 comments on commit 732b927

Please sign in to comment.