@oml/markdown 0.16.2 → 0.16.4

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.
@@ -2792,7 +2792,18 @@ function normalizeImageHref(href) {
2792
2792
  return href;
2793
2793
  }
2794
2794
  try {
2795
- return new URL(href, window.location.href).toString();
2795
+ const params = new URLSearchParams(window.location.search);
2796
+ const isPreviewFrame = params.get('_oml_preview') === '1';
2797
+ let baseHref = document.baseURI || window.location.href;
2798
+ if (isPreviewFrame && window.parent && window.parent !== window) {
2799
+ try {
2800
+ baseHref = window.parent.document.baseURI || window.parent.location.href || baseHref;
2801
+ }
2802
+ catch {
2803
+ // Ignore cross-origin access errors and keep current document base.
2804
+ }
2805
+ }
2806
+ return new URL(href, baseHref).toString();
2796
2807
  }
2797
2808
  catch {
2798
2809
  return href;