File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,19 @@ if (__DEV__) {
179179 parent . tagName ,
180180 ) ;
181181 testElement . innerHTML = html ;
182+
183+ if ( parent . tagName === 'NOSCRIPT' ) {
184+ // <noscript> content is parsed as text, but only if the browser parses it
185+ // together with <noscript> tag itself. So we have to wrap it once more.
186+ var wrapperElement = document . createElement ( 'div' ) ;
187+ wrapperElement . innerHTML = '<noscript>' + html + '</noscript>' ;
188+ var noscriptElement = wrapperElement . firstElementChild ;
189+ // Make Flow happy (but it'll always be there).
190+ if ( noscriptElement !== null && typeof noscriptElement !== 'undefined' ) {
191+ return noscriptElement . innerHTML ;
192+ }
193+ }
194+
182195 return testElement . innerHTML ;
183196 } ;
184197}
You can’t perform that action at this time.
0 commit comments