@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.
@@ -1288,8 +1288,8 @@ function traverse(node, forApp, depth = 0, state = { firstImageFound: false }, p
1288
1288
  if (!node || !node.childNodes) {
1289
1289
  return;
1290
1290
  }
1291
- Array.from(Array(node.childNodes.length).keys()).forEach((i) => {
1292
- const child = node.childNodes[i];
1291
+ const children = Array.from(node.childNodes);
1292
+ children.forEach((child) => {
1293
1293
  if (!child) return;
1294
1294
  if (child.nodeName.toLowerCase() === "a") {
1295
1295
  a(child, forApp, parentDomain, seoContext);
@@ -1306,9 +1306,8 @@ function traverse(node, forApp, depth = 0, state = { firstImageFound: false }, p
1306
1306
  if (child.nodeName.toLowerCase() === "p") {
1307
1307
  p(child);
1308
1308
  }
1309
- const currentChild = node.childNodes[i];
1310
- if (currentChild) {
1311
- traverse(currentChild, forApp, depth + 1, state, parentDomain, seoContext);
1309
+ if (child.parentNode) {
1310
+ traverse(child, forApp, depth + 1, state, parentDomain, seoContext);
1312
1311
  }
1313
1312
  });
1314
1313
  }