@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.
@@ -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
  }
@@ -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
  }