@ecency/render-helper 2.4.1 → 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.
@@ -105,7 +105,7 @@ var TWITCH_EMBED_REGEX = /^(https?:)?\/\/player.twitch.tv\/(?:\?[^/]+)?$/i;
105
105
  var BRAND_NEW_TUBE_REGEX = /^https:\/\/brandnewtube\.com\/embed\/[a-z0-9]+$/i;
106
106
  var LOOM_REGEX = /^(https?:)?\/\/www.loom.com\/share\/([^/?#]+)(?:$|[?#])/i;
107
107
  var LOOM_EMBED_REGEX = /^(https?:)?\/\/www.loom.com\/embed\/([^/?#]+)(?:$|[?#])/i;
108
- var AUREAL_EMBED_REGEX = /^(https?:\/\/)?(www\.)?(?:aureal-embed)\.web\.app\/([0-9]+)(?:$|[?#])/i;
108
+ var AUREAL_EMBED_REGEX = /^(https?:)?\/\/(www\.)?(?:aureal-embed)\.web\.app\/([0-9]+)(?:$|[?#])/i;
109
109
  var ENTITY_REGEX = /&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/ig;
110
110
  var SECTION_REGEX = /\B(\#[\da-zA-Z-_]+\b)(?!;)/i;
111
111
  var ID_WHITELIST = /^[A-Za-z][-A-Za-z0-9_]*$/;
@@ -348,7 +348,7 @@ function img(el, webp, state) {
348
348
  if (isInvalid) {
349
349
  src = "";
350
350
  }
351
- const isRelative = !/^https?:\/\//i.test(src) && !src.startsWith("/");
351
+ const isRelative = !/^https?:\/\//i.test(decodedSrc) && !decodedSrc.startsWith("/");
352
352
  if (isRelative) {
353
353
  src = "";
354
354
  }
@@ -1090,7 +1090,8 @@ function iframe(el, parentDomain = "ecency.com") {
1090
1090
  return;
1091
1091
  }
1092
1092
  if (src.match(AUREAL_EMBED_REGEX)) {
1093
- el.setAttribute("src", src);
1093
+ const normalizedSrc = src.startsWith("//") ? `https:${src}` : src;
1094
+ el.setAttribute("src", normalizedSrc);
1094
1095
  el.setAttribute("frameborder", "0");
1095
1096
  return;
1096
1097
  }