@@ -261,7 +261,6 @@ function reqOverlayDiv(desktopURL, sHeader, sIcon)
261261
262262 // Create the div that we are going to load
263263 const oContainer = new smc_Popup ( containerOptions ) ;
264- const oPopup_body = oContainer . cover . querySelector ( '.popup_content' ) ;
265264
266265 // Load the help page content (we just want the text to show)
267266 fetch ( desktopURL + ( desktopURL . includes ( '?' ) ? ';' : '?' ) + 'ajax' , {
@@ -276,11 +275,14 @@ function reqOverlayDiv(desktopURL, sHeader, sIcon)
276275 } )
277276 . then ( ( res , rej ) => res . ok ? res . text ( ) : rej ( res ) )
278277 . then ( data => {
279- oPopup_body . innerHTML = data ;
278+ const parser = new DOMParser ( ) ;
279+ const doc = parser . parseFromString ( data , "text/html" ) ;
280+ const body = doc ?. querySelector ( 'body div' ) ?. innerHTML ?? data ;
281+ oContainer . setBody ( body ) ;
280282 } )
281283 . catch ( error => {
282- const errorMsg = error . headers . get ( 'x-smf-errormsg' ) ;
283- oPopup_body . innerHTML = errorMsg || error . message || banned_text ;
284+ const errorMsg = error ? .headers ? .get ( 'x-smf-errormsg' ) ?? error ;
285+ oContainer . setBody ( errorMsg || error . message || banned_text ) ;
284286 } ) ;
285287
286288 return false ;
@@ -419,6 +421,11 @@ smc_Popup.prototype.hide = function ()
419421 return false ;
420422}
421423
424+ smc_Popup . prototype . setBody = function ( data )
425+ {
426+ document . getElementById ( this . popup_id ) . querySelector ( '.popup_content' ) . innerHTML = data ;
427+ }
428+
422429// Remember the current position.
423430function storeCaret ( oTextHandle )
424431{
0 commit comments