diff --git a/packages/svelte/src/compiler/phases/constants.js b/packages/svelte/src/compiler/phases/constants.js index 822174d4dd..5fd1005144 100644 --- a/packages/svelte/src/compiler/phases/constants.js +++ b/packages/svelte/src/compiler/phases/constants.js @@ -26,6 +26,8 @@ export const VoidElements = [ 'wbr' ]; +export const RawTextElements = ['textarea', 'script', 'style', 'title']; + export const PassiveEvents = ['wheel', 'touchstart', 'touchmove', 'touchend', 'touchcancel']; export const Runes = /** @type {const} */ ([ diff --git a/packages/svelte/src/internal/server/index.js b/packages/svelte/src/internal/server/index.js index fa491a94b8..35ff92cbd3 100644 --- a/packages/svelte/src/internal/server/index.js +++ b/packages/svelte/src/internal/server/index.js @@ -9,6 +9,7 @@ import { } from '../../constants.js'; import { DEV } from 'esm-env'; import { UNINITIALIZED } from '../client/constants.js'; +import { RawTextElements } from '../../compiler/phases/constants.js'; export * from '../client/validate.js'; @@ -64,8 +65,6 @@ export const VoidElements = new Set([ 'wbr' ]); -export const RawTextElements = new Set(['textarea', 'script', 'style', 'title']); - /** * @type {Element | null} */ @@ -164,11 +163,11 @@ export function element(payload, tag, attributes_fn, children_fn) { payload.out += `>`; if (!VoidElements.has(tag)) { - if (!RawTextElements.has(tag)) { + if (!RawTextElements.includes(tag)) { payload.out += ''; } children_fn(); - if (!RawTextElements.has(tag)) { + if (!RawTextElements.includes(tag)) { payload.out += ''; } payload.out += ``;