File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
src/addons/filter/mathjaxloader/services/handlers Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import { CoreEvents } from '@singletons/events';
2424import { CoreSite } from '@classes/sites/site' ;
2525import { makeSingleton } from '@singletons' ;
2626import { CoreWait } from '@singletons/wait' ;
27+ import { CoreDom } from '@singletons/dom' ;
2728
2829/**
2930 * Handler to support the MathJax filter.
@@ -177,6 +178,10 @@ export class AddonFilterMathJaxLoaderHandlerService extends CoreFilterDefaultHan
177178 ) : Promise < void > {
178179 await this . waitForReady ( ) ;
179180
181+ // Make sure the element is in DOM, otherwise some equations don't work.
182+ // Automatically timeout the promise after a certain time, we don't want to wait forever.
183+ await CoreUtils . ignoreErrors ( CoreUtils . timeoutPromise ( CoreDom . waitToBeInDOM ( container ) , 15000 ) ) ;
184+
180185 await this . window . M ! . filter_mathjaxloader ! . typeset ( container ) ;
181186 }
182187
You can’t perform that action at this time.
0 commit comments