@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.
@@ -452,7 +452,7 @@ function a(el, forApp, parentDomain = "ecency.com", seoContext) {
452
452
  const imgHTML = createImageHTML(href, isLCP);
453
453
  const doc = DOMParser.parseFromString(imgHTML, "text/html");
454
454
  const replaceNode = doc.body?.firstChild || doc.firstChild;
455
- if (replaceNode) {
455
+ if (replaceNode && el.parentNode) {
456
456
  const importedNode = el.ownerDocument.importNode(replaceNode, true);
457
457
  el.parentNode.replaceChild(importedNode, el);
458
458
  }
@@ -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/embed?v=${match[3]}&mode=iframe`;
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);
@@ -946,7 +946,9 @@ function a(el, forApp, parentDomain = "ecency.com", seoContext) {
946
946
  blockquote.appendChild(p2);
947
947
  blockquote.appendChild(textNode);
948
948
  blockquote.appendChild(a2);
949
- el.parentNode.replaceChild(blockquote, el);
949
+ if (el.parentNode) {
950
+ el.parentNode.replaceChild(blockquote, el);
951
+ }
950
952
  return;
951
953
  }
952
954
  }
@@ -1036,7 +1038,7 @@ function iframe(el, parentDomain = "ecency.com") {
1036
1038
  }
1037
1039
  if (src.match(SPEAK_EMBED_REGEX)) {
1038
1040
  let normalizedSrc = src.replace(/(?:play\.)?3speak\.[a-z]+/i, "play.3speak.tv");
1039
- normalizedSrc = normalizedSrc.replace(/\/watch\?/, "/embed?");
1041
+ normalizedSrc = normalizedSrc.replace(/\/embed\?/, "/watch?");
1040
1042
  const hasMode = /[?&]mode=/.test(normalizedSrc);
1041
1043
  if (!hasMode) {
1042
1044
  normalizedSrc = `${normalizedSrc}&mode=iframe`;