@@ -145,7 +145,7 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) {
145
145
}
146
146
147
147
// render JSX to HTML
148
- let s = '' , html ;
148
+ let s = '' , propChildren , html ;
149
149
150
150
if ( props ) {
151
151
let attrs = Object . keys ( props ) ;
@@ -156,7 +156,10 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) {
156
156
for ( let i = 0 ; i < attrs . length ; i ++ ) {
157
157
let name = attrs [ i ] ,
158
158
v = props [ name ] ;
159
- if ( name === 'children' ) continue ;
159
+ if ( name === 'children' ) {
160
+ propChildren = v ;
161
+ continue ;
162
+ }
160
163
161
164
if ( name . match ( / [ \s \n \\ / = ' " \0 < > ] / ) ) continue ;
162
165
@@ -194,6 +197,10 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) {
194
197
if ( name === 'dangerouslySetInnerHTML' ) {
195
198
html = v && v . __html ;
196
199
}
200
+ else if ( nodeName === 'textarea' && name === 'value' ) {
201
+ // <textarea value="a&b"> --> <textarea>a&b</textarea>
202
+ propChildren = v ;
203
+ }
197
204
else if ( ( v || v === 0 || v === '' ) && typeof v !== 'function' ) {
198
205
if ( v === true || v === '' ) {
199
206
v = name ;
@@ -241,7 +248,7 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) {
241
248
}
242
249
s += html ;
243
250
}
244
- else if ( props && getChildren ( children = [ ] , props . children ) . length ) {
251
+ else if ( propChildren != null && getChildren ( children = [ ] , propChildren ) . length ) {
245
252
let hasLarge = pretty && ~ s . indexOf ( '\n' ) ;
246
253
let lastWasText = false ;
247
254
0 commit comments