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