@ecency/render-helper 2.4.17 → 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.
package/dist/node/index.mjs
CHANGED
|
@@ -902,7 +902,7 @@ function a(el, forApp, parentDomain = "ecency.com", seoContext) {
|
|
|
902
902
|
const imgEls2 = el.getElementsByTagName("img");
|
|
903
903
|
if (imgEls2.length === 1 || el.textContent.trim() === href) {
|
|
904
904
|
if ((match[1] || match[2]) && match[3]) {
|
|
905
|
-
const videoHref = `https://play.3speak.tv/
|
|
905
|
+
const videoHref = `https://play.3speak.tv/watch?v=${match[3]}&mode=iframe`;
|
|
906
906
|
el.setAttribute("class", "markdown-video-link markdown-video-link-speak");
|
|
907
907
|
el.removeAttribute("href");
|
|
908
908
|
el.setAttribute("data-embed-src", videoHref);
|
|
@@ -1038,7 +1038,7 @@ function iframe(el, parentDomain = "ecency.com") {
|
|
|
1038
1038
|
}
|
|
1039
1039
|
if (src.match(SPEAK_EMBED_REGEX)) {
|
|
1040
1040
|
let normalizedSrc = src.replace(/(?:play\.)?3speak\.[a-z]+/i, "play.3speak.tv");
|
|
1041
|
-
normalizedSrc = normalizedSrc.replace(/\/
|
|
1041
|
+
normalizedSrc = normalizedSrc.replace(/\/embed\?/, "/watch?");
|
|
1042
1042
|
const hasMode = /[?&]mode=/.test(normalizedSrc);
|
|
1043
1043
|
if (!hasMode) {
|
|
1044
1044
|
normalizedSrc = `${normalizedSrc}&mode=iframe`;
|
|
@@ -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(
|
|
1292
|
-
|
|
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
|
-
|
|
1310
|
-
|
|
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
|
}
|