@@ -1100,15 +1100,39 @@ function pushStartPreformattedElement(
1100
1100
responseState : ResponseState ,
1101
1101
assignID : null | SuspenseBoundaryID ,
1102
1102
) : ReactNodeList {
1103
- const children = pushStartGenericElement (
1104
- target ,
1105
- props ,
1106
- tag ,
1107
- responseState ,
1108
- assignID ,
1109
- ) ;
1103
+ target . push ( startChunkForTag ( tag ) ) ;
1104
+
1105
+ let children = null ;
1106
+ let innerHTML = null ;
1107
+ for ( const propKey in props ) {
1108
+ if ( hasOwnProperty . call ( props , propKey ) ) {
1109
+ const propValue = props [ propKey ] ;
1110
+ if ( propValue == null ) {
1111
+ continue ;
1112
+ }
1113
+ switch ( propKey ) {
1114
+ case 'children ':
1115
+ children = propValue ;
1116
+ break ;
1117
+ case 'dangerouslySetInnerHTML ':
1118
+ innerHTML = propValue ;
1119
+ break ;
1120
+ default :
1121
+ pushAttribute ( target , responseState , propKey , propValue ) ;
1122
+ break ;
1123
+ }
1124
+ }
1125
+ }
1126
+ if ( assignID !== null ) {
1127
+ pushID ( target , responseState , assignID , props . id ) ;
1128
+ }
1129
+
1130
+ target . push ( endOfStartTag ) ;
1110
1131
1111
- if ( typeof children === 'string' && children [ 0 ] === '\n' ) {
1132
+ if (
1133
+ ( typeof children === 'string' && children [ 0 ] === '\n' ) ||
1134
+ ( typeof innerHTML === 'string' && innerHTML [ 0 ] === '\n' )
1135
+ ) {
1112
1136
// text/html ignores the first character in these tags if it's a newline
1113
1137
// Prefer to break application/xml over text/html (for now) by adding
1114
1138
// a newline specifically to get eaten by the parser. (Alternately for
@@ -1124,6 +1148,7 @@ function pushStartPreformattedElement(
1124
1148
target . push ( leadingNewline ) ;
1125
1149
}
1126
1150
1151
+ pushInnerHTML ( target , innerHTML , children ) ;
1127
1152
return children ;
1128
1153
}
1129
1154
0 commit comments