@ecency/render-helper 2.4.2 → 2.4.3

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.
@@ -96,7 +96,7 @@ var TWITCH_EMBED_REGEX = /^(https?:)?\/\/player.twitch.tv\/(?:\?[^/]+)?$/i;
96
96
  var BRAND_NEW_TUBE_REGEX = /^https:\/\/brandnewtube\.com\/embed\/[a-z0-9]+$/i;
97
97
  var LOOM_REGEX = /^(https?:)?\/\/www.loom.com\/share\/([^/?#]+)(?:$|[?#])/i;
98
98
  var LOOM_EMBED_REGEX = /^(https?:)?\/\/www.loom.com\/embed\/([^/?#]+)(?:$|[?#])/i;
99
- var AUREAL_EMBED_REGEX = /^(https?:\/\/)?(www\.)?(?:aureal-embed)\.web\.app\/([0-9]+)(?:$|[?#])/i;
99
+ var AUREAL_EMBED_REGEX = /^(https?:)?\/\/(www\.)?(?:aureal-embed)\.web\.app\/([0-9]+)(?:$|[?#])/i;
100
100
  var ENTITY_REGEX = /&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/ig;
101
101
  var SECTION_REGEX = /\B(\#[\da-zA-Z-_]+\b)(?!;)/i;
102
102
  var ID_WHITELIST = /^[A-Za-z][-A-Za-z0-9_]*$/;
@@ -336,7 +336,7 @@ function img(el, webp, state) {
336
336
  if (isInvalid) {
337
337
  src = "";
338
338
  }
339
- const isRelative = !/^https?:\/\//i.test(src) && !src.startsWith("/");
339
+ const isRelative = !/^https?:\/\//i.test(decodedSrc) && !decodedSrc.startsWith("/");
340
340
  if (isRelative) {
341
341
  src = "";
342
342
  }
@@ -1078,7 +1078,8 @@ function iframe(el, parentDomain = "ecency.com") {
1078
1078
  return;
1079
1079
  }
1080
1080
  if (src.match(AUREAL_EMBED_REGEX)) {
1081
- el.setAttribute("src", src);
1081
+ const normalizedSrc = src.startsWith("//") ? `https:${src}` : src;
1082
+ el.setAttribute("src", normalizedSrc);
1082
1083
  el.setAttribute("frameborder", "0");
1083
1084
  return;
1084
1085
  }