File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 UNSAFE_NAME ,
55 NAMESPACE_REPLACE_REGEX ,
66 HTML_LOWER_CASE ,
7- HTML_ELEMENTS ,
87 HTML_ENUMERATED ,
98 SVG_CAMEL_CASE ,
109 createComponent ,
@@ -301,6 +300,8 @@ function _renderToString(
301300
302301 let type = vnode . type ,
303302 props = vnode . props ;
303+
304+ const isCustomElement = type . includes ( "-" ) ;
304305
305306 // Invoke rendering on Components
306307 if ( typeof type == 'function' ) {
@@ -667,7 +668,7 @@ function _renderToString(
667668 ? 'panose-1'
668669 : name . replace ( / ( [ A - Z ] ) / g, '-$1' ) . toLowerCase ( ) ;
669670 }
670- } else if ( HTML_ELEMENTS . has ( type ) && HTML_LOWER_CASE . has ( name ) ) {
671+ } else if ( ! isCustomElement && HTML_LOWER_CASE . has ( name ) ) {
671672 name = name . toLowerCase ( ) ;
672673 }
673674 }
Original file line number Diff line number Diff line change @@ -2,120 +2,6 @@ import { DIRTY, BITS } from './constants';
22
33export const VOID_ELEMENTS = / ^ (?: a r e a | b a s e | b r | c o l | e m b e d | h r | i m g | i n p u t | l i n k | m e t a | p a r a m | s o u r c e | t r a c k | w b r ) $ / ;
44
5- export const HTML_ELEMENTS = new Set ( [
6- 'a' ,
7- 'abbr' ,
8- 'address' ,
9- 'area' ,
10- 'article' ,
11- 'aside' ,
12- 'audio' ,
13- 'b' ,
14- 'base' ,
15- 'bdi' ,
16- 'bdo' ,
17- 'blockquote' ,
18- 'body' ,
19- 'br' ,
20- 'button' ,
21- 'canvas' ,
22- 'caption' ,
23- 'cite' ,
24- 'code' ,
25- 'col' ,
26- 'colgroup' ,
27- 'data' ,
28- 'datalist' ,
29- 'dd' ,
30- 'del' ,
31- 'details' ,
32- 'dfn' ,
33- 'dialog' ,
34- 'div' ,
35- 'dl' ,
36- 'dt' ,
37- 'em' ,
38- 'embed' ,
39- 'fieldset' ,
40- 'figcaption' ,
41- 'figure' ,
42- 'footer' ,
43- 'form' ,
44- 'h1' ,
45- 'h2' ,
46- 'h3' ,
47- 'h4' ,
48- 'h5' ,
49- 'h6' ,
50- 'head' ,
51- 'header' ,
52- 'hgroup' ,
53- 'hr' ,
54- 'html' ,
55- 'i' ,
56- 'iframe' ,
57- 'img' ,
58- 'input' ,
59- 'ins' ,
60- 'kbd' ,
61- 'label' ,
62- 'legend' ,
63- 'li' ,
64- 'link' ,
65- 'main' ,
66- 'map' ,
67- 'mark' ,
68- 'menu' ,
69- 'meta' ,
70- 'meter' ,
71- 'nav' ,
72- 'noscript' ,
73- 'object' ,
74- 'ol' ,
75- 'optgroup' ,
76- 'option' ,
77- 'output' ,
78- 'p' ,
79- 'picture' ,
80- 'pre' ,
81- 'progress' ,
82- 'q' ,
83- 'rp' ,
84- 'rt' ,
85- 'ruby' ,
86- 's' ,
87- 'samp' ,
88- 'script' ,
89- 'search' ,
90- 'section' ,
91- 'select' ,
92- 'slot' ,
93- 'small' ,
94- 'source' ,
95- 'span' ,
96- 'strong' ,
97- 'style' ,
98- 'sub' ,
99- 'summary' ,
100- 'sup' ,
101- 'table' ,
102- 'tbody' ,
103- 'td' ,
104- 'template' ,
105- 'textarea' ,
106- 'tfoot' ,
107- 'th' ,
108- 'thead' ,
109- 'time' ,
110- 'title' ,
111- 'tr' ,
112- 'track' ,
113- 'u' ,
114- 'ul' ,
115- 'var' ,
116- 'video' ,
117- 'wbr'
118- ] ) ;
1195// oxlint-disable-next-line no-control-regex
1206export const UNSAFE_NAME = / [ \s \n \\ / = ' " \0 < > ] / ;
1217export const NAMESPACE_REPLACE_REGEX = / ^ ( x l i n k | x m l n s | x m l ) ( [ A - Z ] ) / ;
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import {
1111 SVG_CAMEL_CASE ,
1212 HTML_ENUMERATED ,
1313 HTML_LOWER_CASE ,
14- HTML_ELEMENTS ,
1514 getContext ,
1615 setDirty ,
1716 isDirty ,
@@ -130,6 +129,8 @@ function _renderToStringPretty(
130129 props = vnode . props ,
131130 isComponent = false ;
132131
132+ const isCustomElement = nodeName . includes ( "-" ) ;
133+
133134 // components
134135 if ( typeof nodeName === 'function' ) {
135136 isComponent = true ;
@@ -300,7 +301,7 @@ function _renderToStringPretty(
300301 ? 'panose-1'
301302 : name . replace ( / ( [ A - Z ] ) / g, '-$1' ) . toLowerCase ( ) ;
302303 }
303- } else if ( HTML_ELEMENTS . has ( nodeName ) && HTML_LOWER_CASE . has ( name ) ) {
304+ } else if ( ! isCustomElement && HTML_LOWER_CASE . has ( name ) ) {
304305 name = name . toLowerCase ( ) ;
305306 }
306307
You can’t perform that action at this time.
0 commit comments