forked from CIT/Vmeda.Online
		
	Merge pull request #4195 from dpalou/MOBILE-4672
MOBILE-4672 mathjax: Fix some equations not displayed in quiz
This commit is contained in:
		
						commit
						6d2b1ed902
					
				@ -24,6 +24,7 @@ import { CoreEvents } from '@singletons/events';
 | 
				
			|||||||
import { CoreSite } from '@classes/sites/site';
 | 
					import { CoreSite } from '@classes/sites/site';
 | 
				
			||||||
import { makeSingleton } from '@singletons';
 | 
					import { makeSingleton } from '@singletons';
 | 
				
			||||||
import { CoreWait } from '@singletons/wait';
 | 
					import { CoreWait } from '@singletons/wait';
 | 
				
			||||||
 | 
					import { CoreDom } from '@singletons/dom';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Handler to support the MathJax filter.
 | 
					 * Handler to support the MathJax filter.
 | 
				
			||||||
@ -177,6 +178,10 @@ export class AddonFilterMathJaxLoaderHandlerService extends CoreFilterDefaultHan
 | 
				
			|||||||
    ): Promise<void> {
 | 
					    ): Promise<void> {
 | 
				
			||||||
        await this.waitForReady();
 | 
					        await this.waitForReady();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Make sure the element is in DOM, otherwise some equations don't work.
 | 
				
			||||||
 | 
					        // Automatically timeout the promise after a certain time, we don't want to wait forever.
 | 
				
			||||||
 | 
					        await CoreUtils.ignoreErrors(CoreUtils.timeoutPromise(CoreDom.waitToBeInDOM(container), 15000));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        await this.window.M!.filter_mathjaxloader!.typeset(container);
 | 
					        await this.window.M!.filter_mathjaxloader!.typeset(container);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user