@ecency/render-helper 2.4.18 → 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 +13 -7
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +13 -7
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +13 -7
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.cjs
CHANGED
|
@@ -1317,9 +1317,10 @@ function traverse(node, forApp, depth = 0, state = { firstImageFound: false }, p
|
|
|
1317
1317
|
if (!node || !node.childNodes) {
|
|
1318
1318
|
return;
|
|
1319
1319
|
}
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1320
|
+
let child = node.firstChild;
|
|
1321
|
+
while (child) {
|
|
1322
|
+
const next = child.nextSibling;
|
|
1323
|
+
const prev = child.previousSibling;
|
|
1323
1324
|
if (child.nodeName.toLowerCase() === "a") {
|
|
1324
1325
|
a(child, forApp, parentDomain, seoContext);
|
|
1325
1326
|
}
|
|
@@ -1335,11 +1336,16 @@ function traverse(node, forApp, depth = 0, state = { firstImageFound: false }, p
|
|
|
1335
1336
|
if (child.nodeName.toLowerCase() === "p") {
|
|
1336
1337
|
p(child);
|
|
1337
1338
|
}
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1339
|
+
if (child.parentNode) {
|
|
1340
|
+
traverse(child, forApp, depth + 1, state, parentDomain, seoContext);
|
|
1341
|
+
} else {
|
|
1342
|
+
const possibleReplacement = next ? next.previousSibling : node.lastChild;
|
|
1343
|
+
if (possibleReplacement && possibleReplacement !== prev && possibleReplacement.parentNode === node) {
|
|
1344
|
+
traverse(possibleReplacement, forApp, depth + 1, state, parentDomain, seoContext);
|
|
1345
|
+
}
|
|
1341
1346
|
}
|
|
1342
|
-
|
|
1347
|
+
child = next;
|
|
1348
|
+
}
|
|
1343
1349
|
}
|
|
1344
1350
|
|
|
1345
1351
|
// src/methods/clean-reply.method.ts
|