@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_]*$/;
@@ -339,7 +339,7 @@ function img(el, webp, state) {
339
339
  if (isInvalid) {
340
340
  src = "";
341
341
  }
342
- const isRelative = !/^https?:\/\//i.test(src) && !src.startsWith("/");
342
+ const isRelative = !/^https?:\/\//i.test(decodedSrc) && !decodedSrc.startsWith("/");
343
343
  if (isRelative) {
344
344
  src = "";
345
345
  }
@@ -1081,7 +1081,8 @@ function iframe(el, parentDomain = "ecency.com") {
1081
1081
  return;
1082
1082
  }
1083
1083
  if (src.match(AUREAL_EMBED_REGEX)) {
1084
- el.setAttribute("src", src);
1084
+ const normalizedSrc = src.startsWith("//") ? `https:${src}` : src;
1085
+ el.setAttribute("src", normalizedSrc);
1085
1086
  el.setAttribute("frameborder", "0");
1086
1087
  return;
1087
1088
  }