@ecency/render-helper 2.4.19 → 2.4.20
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.
- package/dist/browser/index.js +11 -4
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +11 -4
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +11 -4
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.mjs
CHANGED
|
@@ -1288,9 +1288,10 @@ function traverse(node, forApp, depth = 0, state = { firstImageFound: false }, p
|
|
|
1288
1288
|
if (!node || !node.childNodes) {
|
|
1289
1289
|
return;
|
|
1290
1290
|
}
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1291
|
+
let child = node.firstChild;
|
|
1292
|
+
while (child) {
|
|
1293
|
+
const next = child.nextSibling;
|
|
1294
|
+
const prev = child.previousSibling;
|
|
1294
1295
|
if (child.nodeName.toLowerCase() === "a") {
|
|
1295
1296
|
a(child, forApp, parentDomain, seoContext);
|
|
1296
1297
|
}
|
|
@@ -1308,8 +1309,14 @@ function traverse(node, forApp, depth = 0, state = { firstImageFound: false }, p
|
|
|
1308
1309
|
}
|
|
1309
1310
|
if (child.parentNode) {
|
|
1310
1311
|
traverse(child, forApp, depth + 1, state, parentDomain, seoContext);
|
|
1312
|
+
} else {
|
|
1313
|
+
const possibleReplacement = next ? next.previousSibling : node.lastChild;
|
|
1314
|
+
if (possibleReplacement && possibleReplacement !== prev && possibleReplacement.parentNode === node) {
|
|
1315
|
+
traverse(possibleReplacement, forApp, depth + 1, state, parentDomain, seoContext);
|
|
1316
|
+
}
|
|
1311
1317
|
}
|
|
1312
|
-
|
|
1318
|
+
child = next;
|
|
1319
|
+
}
|
|
1313
1320
|
}
|
|
1314
1321
|
|
|
1315
1322
|
// src/methods/clean-reply.method.ts
|