@ecency/render-helper 2.5.1 → 2.5.2

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.
@@ -459,7 +459,7 @@ function sanitizeHtml(html) {
459
459
  }
460
460
  });
461
461
  }
462
- var proxyBase = "https://images.ecency.com";
462
+ var proxyBase = "https://i.ecency.com";
463
463
  var urlHashCache = new LRUCache({ max: 500 });
464
464
  function getUrlHash(url) {
465
465
  const cached = urlHashCache.get(url);
@@ -502,6 +502,9 @@ function proxifyImageSrc(url, width = 0, height = 0, _format = "match") {
502
502
  if (url.indexOf("https://steemitimages.com/") === 0 && url.indexOf("https://steemitimages.com/D") !== 0) {
503
503
  return url.replace("https://steemitimages.com", proxyBase);
504
504
  }
505
+ if (url.indexOf("https://images.ecency.com/") === 0) {
506
+ return url.replace("https://images.ecency.com", proxyBase);
507
+ }
505
508
  const realUrl = getLatestUrl(url);
506
509
  const pHash = extractPHash(realUrl);
507
510
  const options = {
@@ -1458,7 +1461,7 @@ function linkify(content, forApp, renderOptions) {
1458
1461
  const preceedings = (preceeding1 || "") + (preceeding2 || "");
1459
1462
  if (userLower.indexOf("/") === -1 && isValidUsername(user)) {
1460
1463
  if (!forApp) {
1461
- const avatarSrc = `https://images.ecency.com/u/${userLower}/avatar/small`;
1464
+ const avatarSrc = `${getProxyBase()}/u/${userLower}/avatar/small`;
1462
1465
  const html = `${preceedings}<a class="er-author er-author-link" href="/@${userLower}"><img class="er-author-link-image" src="${avatarSrc}" alt="${userLower}"/><span class="er-author-link-content"><span class="er-author-link-label">Hive account</span><span>@${userLower}</span></span></a>`;
1463
1466
  const placeholder = `\u200C${authorPlaceholders.length}\u200C`;
1464
1467
  authorPlaceholders.push({ placeholder, html });