@ecency/render-helper 2.5.33 → 2.5.34
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.
package/dist/node/index.mjs
CHANGED
|
@@ -747,7 +747,6 @@ var isSafeNavValue = (value) => {
|
|
|
747
747
|
const isRelative = /^(\/\/|\/[^/]?|#|\?|[a-z0-9._\-]+(\/|$))/i.test(trimmed);
|
|
748
748
|
return isSafeScheme || isRelative;
|
|
749
749
|
};
|
|
750
|
-
var decodeEntities2 = (input) => input.replace(/&#(\d+);?/g, (_, dec) => String.fromCodePoint(Number(dec))).replace(/&#x([0-9a-f]+);?/gi, (_, hex) => String.fromCodePoint(parseInt(hex, 16)));
|
|
751
750
|
var isProxyPSrcset = (srcset) => {
|
|
752
751
|
const base = trimTrailingSlash(getProxyBase());
|
|
753
752
|
const candidates = srcset.split(",").map((c) => c.trim().split(/\s+/)[0]).filter(Boolean);
|
|
@@ -761,7 +760,7 @@ function sanitizeHtml(html) {
|
|
|
761
760
|
css: false,
|
|
762
761
|
// block style attrs entirely for safety
|
|
763
762
|
onTagAttr: (tag, name, value) => {
|
|
764
|
-
const decoded =
|
|
763
|
+
const decoded = decodeEntities(value.trim());
|
|
765
764
|
const decodedLower = decoded.toLowerCase();
|
|
766
765
|
if (name.startsWith("on")) return "";
|
|
767
766
|
if (tag === "img" && name === "src" && !/^https?:\/\//.test(decodedLower)) return "";
|