@ecency/render-helper 2.4.18 → 2.4.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1317,8 +1317,8 @@ function traverse(node, forApp, depth = 0, state = { firstImageFound: false }, p
1317
1317
  if (!node || !node.childNodes) {
1318
1318
  return;
1319
1319
  }
1320
- Array.from(Array(node.childNodes.length).keys()).forEach((i) => {
1321
- const child = node.childNodes[i];
1320
+ const children = Array.from(node.childNodes);
1321
+ children.forEach((child) => {
1322
1322
  if (!child) return;
1323
1323
  if (child.nodeName.toLowerCase() === "a") {
1324
1324
  a(child, forApp, parentDomain, seoContext);
@@ -1335,9 +1335,8 @@ function traverse(node, forApp, depth = 0, state = { firstImageFound: false }, p
1335
1335
  if (child.nodeName.toLowerCase() === "p") {
1336
1336
  p(child);
1337
1337
  }
1338
- const currentChild = node.childNodes[i];
1339
- if (currentChild) {
1340
- traverse(currentChild, forApp, depth + 1, state, parentDomain, seoContext);
1338
+ if (child.parentNode) {
1339
+ traverse(child, forApp, depth + 1, state, parentDomain, seoContext);
1341
1340
  }
1342
1341
  });
1343
1342
  }