@ecency/render-helper 2.4.16 → 2.4.18

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.
@@ -481,7 +481,7 @@ function a(el, forApp, parentDomain = "ecency.com", seoContext) {
481
481
  const imgHTML = createImageHTML(href, isLCP);
482
482
  const doc = DOMParser.parseFromString(imgHTML, "text/html");
483
483
  const replaceNode = doc.body?.firstChild || doc.firstChild;
484
- if (replaceNode) {
484
+ if (replaceNode && el.parentNode) {
485
485
  const importedNode = el.ownerDocument.importNode(replaceNode, true);
486
486
  el.parentNode.replaceChild(importedNode, el);
487
487
  }
@@ -931,7 +931,7 @@ function a(el, forApp, parentDomain = "ecency.com", seoContext) {
931
931
  const imgEls2 = el.getElementsByTagName("img");
932
932
  if (imgEls2.length === 1 || el.textContent.trim() === href) {
933
933
  if ((match[1] || match[2]) && match[3]) {
934
- const videoHref = `https://play.3speak.tv/embed?v=${match[3]}&mode=iframe`;
934
+ const videoHref = `https://play.3speak.tv/watch?v=${match[3]}&mode=iframe`;
935
935
  el.setAttribute("class", "markdown-video-link markdown-video-link-speak");
936
936
  el.removeAttribute("href");
937
937
  el.setAttribute("data-embed-src", videoHref);
@@ -975,7 +975,9 @@ function a(el, forApp, parentDomain = "ecency.com", seoContext) {
975
975
  blockquote.appendChild(p2);
976
976
  blockquote.appendChild(textNode);
977
977
  blockquote.appendChild(a2);
978
- el.parentNode.replaceChild(blockquote, el);
978
+ if (el.parentNode) {
979
+ el.parentNode.replaceChild(blockquote, el);
980
+ }
979
981
  return;
980
982
  }
981
983
  }
@@ -1065,7 +1067,7 @@ function iframe(el, parentDomain = "ecency.com") {
1065
1067
  }
1066
1068
  if (src.match(SPEAK_EMBED_REGEX)) {
1067
1069
  let normalizedSrc = src.replace(/(?:play\.)?3speak\.[a-z]+/i, "play.3speak.tv");
1068
- normalizedSrc = normalizedSrc.replace(/\/watch\?/, "/embed?");
1070
+ normalizedSrc = normalizedSrc.replace(/\/embed\?/, "/watch?");
1069
1071
  const hasMode = /[?&]mode=/.test(normalizedSrc);
1070
1072
  if (!hasMode) {
1071
1073
  normalizedSrc = `${normalizedSrc}&mode=iframe`;