moved raw text elements to constands and made array

pull/10936/head
Daniel 2 years ago
parent cd621d8f46
commit 6af955edad

@ -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} */ ([

@ -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 += `</${tag}>`;

Loading…
Cancel
Save