MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / initializeMathJax

Function initializeMathJax

client/src/utils/math-jax.ts:38–47  ·  view source on GitHub ↗
(mathJaxChallenge = true)

Source from the content-addressed store, hash-verified

36};
37
38export const initializeMathJax = (mathJaxChallenge = true) => {
39 const mathJaxMountPoint = document.querySelector('#mathjax');
40 if (global.MathJax) {
41 // Configure MathJax when it's loaded and
42 // users navigate from another challenge
43 configure();
44 } else if (!mathJaxMountPoint && mathJaxChallenge) {
45 mathJaxScriptLoader();
46 }
47};
48
49const mathJaxScriptLoader = () => {
50 scriptLoader('mathjax', false, mathJaxSrc, configure, '');

Callers 3

MultipleChoiceQuestionsFunction · 0.90
ChallengeDescriptionFunction · 0.90
editorDidMountFunction · 0.90

Calls 2

mathJaxScriptLoaderFunction · 0.85
configureFunction · 0.70

Tested by

no test coverage detected