@ecency/render-helper 2.5.36 → 2.5.38

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.
@@ -714,6 +714,9 @@ function buildSrcSetForFormat(url, format = "match") {
714
714
  var STATIC_RASTER_PATH_EXT = /\.(?:jpe?g|png|webp)$/i;
715
715
  var SIZED_PROXY_PATH = /^\/\d+x\d+\//;
716
716
  function isPictureEligibleRawUrl(rawUrl) {
717
+ return isPictureEligible(rawUrl, true);
718
+ }
719
+ function isPictureEligible(rawUrl, mayUnwrapLegacy) {
717
720
  if (!rawUrl || typeof rawUrl !== "string") return false;
718
721
  let u;
719
722
  try {
@@ -722,7 +725,10 @@ function isPictureEligibleRawUrl(rawUrl) {
722
725
  return false;
723
726
  }
724
727
  if (u.protocol !== "http:" && u.protocol !== "https:") return false;
725
- if (isLegacySizedProxyUrl(rawUrl)) return true;
728
+ if (mayUnwrapLegacy && isLegacySizedProxyUrl(rawUrl)) {
729
+ const nested = extractLegacySizedSource(rawUrl);
730
+ return nested !== null && isPictureEligible(nested, false);
731
+ }
726
732
  const host = `${u.protocol}//${u.host}`;
727
733
  const isProxyHost = host === proxyBase || host === "https://images.ecency.com";
728
734
  if (isProxyHost && (u.pathname.startsWith("/p/") || u.pathname.startsWith("/u/") || SIZED_PROXY_PATH.test(u.pathname))) {