File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -625,7 +625,7 @@ function _renderToString(
625
625
} else if ( UNSAFE_NAME . test ( name ) ) {
626
626
continue ;
627
627
} else if (
628
- ( name [ 4 ] === '-' || HTML_ENUMERATED . test ( name ) ) &&
628
+ ( name [ 4 ] === '-' || HTML_ENUMERATED . has ( name ) ) &&
629
629
v != null
630
630
) {
631
631
// serialize boolean aria-xyz or enumerated attribute values as strings
Original file line number Diff line number Diff line change @@ -2,9 +2,11 @@ export const VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|link|meta|
2
2
export const UNSAFE_NAME = / [ \s \n \\ / = ' " \0 < > ] / ;
3
3
export const NAMESPACE_REPLACE_REGEX = / ^ ( x l i n k | x m l n s | x m l ) ( [ A - Z ] ) / ;
4
4
export const HTML_LOWER_CASE = / ^ a c c e s s K | ^ a u t o [ A - Z ] | ^ c e l l | ^ c h | ^ c o l | c o n t | c r o s s | d a t e T | e n c T | f o r m [ A - Z ] | f r a m e | h r e f L | i n p u t M | m a x L | m i n L | n o V | p l a y s I | p o p o v e r T | r e a d O | r o w S | s r c [ A - Z ] | t a b I | u s e M | i t e m [ A - Z ] / ;
5
- export const HTML_ENUMERATED = / ^ d r a | s p e l / ;
6
5
export const SVG_CAMEL_CASE = / ^ a c | ^ a l i | a r a b i c | b a s e l | c a p | c l i p P a t h $ | c l i p R u l e $ | c o l o r | d o m i n a n t | e n a b l e | f i l l | f l o o d | f o n t | g l y p h [ ^ R ] | h o r i z | i m a g e | l e t t e r | l i g h t i n g | m a r k e r [ ^ W U H ] | o v e r l i n e | p a n o s e | p o i n t e | p a i n t | r e n d e r i n g | s h a p e | s t o p | s t r i k e t h r o u g h | s t r o k e | t e x t [ ^ L ] | t r a n s f o r m | u n d e r l i n e | u n i c o d e | u n i t s | ^ v [ ^ i ] | ^ w | ^ x H / ;
7
6
7
+ // Boolean DOM properties that translate to enumerated ('true'/'false') attributes
8
+ export const HTML_ENUMERATED = new Set ( [ 'draggable' , 'spellcheck' ] ) ;
9
+
8
10
// DOM properties that should NOT have "px" added when numeric
9
11
const ENCODED_ENTITIES = / [ " & < ] / ;
10
12
You can’t perform that action at this time.
0 commit comments