zova-vite 1.1.51 → 1.1.52
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 +5 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -442,6 +442,11 @@ function collectTeleports(html, teleports) {
|
|
|
442
442
|
function renderTeleports(teleports) {
|
|
443
443
|
if (!teleports) return '';
|
|
444
444
|
return Object.entries(teleports).reduce((all, [key, value]) => {
|
|
445
|
+
// This serializer creates dedicated containers, not arbitrary CSS selector targets.
|
|
446
|
+
const target = /^#[a-z_][\w-]*/i.exec(key);
|
|
447
|
+
if (!target || target[0] !== key) {
|
|
448
|
+
throw new Error(`Unsupported SSR Teleport target ${JSON.stringify(key)}. Only simple #id targets are supported (ASCII letter or underscore first, then letters, digits, underscores, or hyphens). Use a dedicated Teleport container, not body.`);
|
|
449
|
+
}
|
|
445
450
|
return `${all}<div id="${key.slice(1)}">${value}</div>`;
|
|
446
451
|
}, '');
|
|
447
452
|
}
|
package/package.json
CHANGED