@yoamigo.com/core 0.3.4 → 0.3.6
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/index.js +13 -11
- package/dist/plugin.js +6 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1055,17 +1055,19 @@ import DOMPurify from "dompurify";
|
|
|
1055
1055
|
import { Fragment, jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
1056
1056
|
var ALLOWED_TAGS = ["strong", "em", "a", "span", "br", "b", "i", "u"];
|
|
1057
1057
|
var ALLOWED_ATTR = ["href", "style", "class", "target", "rel"];
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
const
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
}
|
|
1058
|
+
if (typeof window !== "undefined") {
|
|
1059
|
+
DOMPurify.addHook("uponSanitizeAttribute", (_node, data) => {
|
|
1060
|
+
if (data.attrName === "style") {
|
|
1061
|
+
const allowedStyles = ["font-size", "font-weight"];
|
|
1062
|
+
const styleValue = data.attrValue;
|
|
1063
|
+
const filteredStyles = styleValue.split(";").map((s) => s.trim()).filter((s) => {
|
|
1064
|
+
const [prop] = s.split(":").map((p) => p.trim());
|
|
1065
|
+
return allowedStyles.includes(prop);
|
|
1066
|
+
}).join("; ");
|
|
1067
|
+
data.attrValue = filteredStyles;
|
|
1068
|
+
}
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
1069
1071
|
function extractLinkDisplayText(href) {
|
|
1070
1072
|
if (!href) return { text: "link", isExternal: false };
|
|
1071
1073
|
if (href.startsWith("#")) {
|
package/dist/plugin.js
CHANGED
|
@@ -81,6 +81,12 @@ if (import.meta.hot) {
|
|
|
81
81
|
port: process.env.PORT ? parseInt(process.env.PORT, 10) : 5173,
|
|
82
82
|
strictPort: false,
|
|
83
83
|
// Allow Vite to find next available port
|
|
84
|
+
watch: {
|
|
85
|
+
// Prevent Vite from watching node_modules and pnpm store
|
|
86
|
+
// Critical when node_modules contains symlinks to pnpm store (bundled deps)
|
|
87
|
+
// Without this, Vite exceeds inotify file watcher limit (ENOSPC error)
|
|
88
|
+
ignored: ["**/node_modules/**", "**/.pnpm-store/**"]
|
|
89
|
+
},
|
|
84
90
|
hmr: {
|
|
85
91
|
// When behind a proxy (builder worker), HMR needs to connect through the proxy
|
|
86
92
|
// Setting these to undefined lets Vite auto-detect from the page URL
|