File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -110,19 +110,22 @@ export default function render(
110
110
}
111
111
112
112
function renderNode ( node : Node , options : DomSerializerOptions ) : string {
113
- switch ( node . type as string ) {
114
- case "root" :
113
+ switch ( node . type ) {
114
+ case ElementType . Root :
115
115
return render ( ( node as NodeWithChildren ) . children , options ) ;
116
116
case ElementType . Directive :
117
+ case ElementType . Doctype :
117
118
return renderDirective ( node as DataNode ) ;
118
119
case ElementType . Comment :
119
120
return renderComment ( node as DataNode ) ;
120
121
case ElementType . CDATA :
121
122
return renderCdata ( node as NodeWithChildren ) ;
122
- default :
123
- return ElementType . isTag ( node )
124
- ? renderTag ( node as Element , options )
125
- : renderText ( node as DataNode , options ) ;
123
+ case ElementType . Script :
124
+ case ElementType . Style :
125
+ case ElementType . Tag :
126
+ return renderTag ( node as Element , options ) ;
127
+ case ElementType . Text :
128
+ return renderText ( node as DataNode , options ) ;
126
129
}
127
130
}
128
131
You can’t perform that action at this time.
0 commit comments