@ecency/render-helper 2.4.16 → 2.4.17

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.
@@ -449,7 +449,7 @@ function a(el, forApp, parentDomain = "ecency.com", seoContext) {
449
449
  const imgHTML = createImageHTML(href, isLCP);
450
450
  const doc = DOMParser.parseFromString(imgHTML, "text/html");
451
451
  const replaceNode = doc.body?.firstChild || doc.firstChild;
452
- if (replaceNode) {
452
+ if (replaceNode && el.parentNode) {
453
453
  const importedNode = el.ownerDocument.importNode(replaceNode, true);
454
454
  el.parentNode.replaceChild(importedNode, el);
455
455
  }
@@ -943,7 +943,9 @@ function a(el, forApp, parentDomain = "ecency.com", seoContext) {
943
943
  blockquote.appendChild(p2);
944
944
  blockquote.appendChild(textNode);
945
945
  blockquote.appendChild(a2);
946
- el.parentNode.replaceChild(blockquote, el);
946
+ if (el.parentNode) {
947
+ el.parentNode.replaceChild(blockquote, el);
948
+ }
947
949
  return;
948
950
  }
949
951
  }