Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
feat: upgrade mathjax from v2 to v3
Browse files Browse the repository at this point in the history
  • Loading branch information
navinkarkera committed Oct 26, 2023
1 parent c75f877 commit 4c8ffde
Showing 1 changed file with 25 additions and 32 deletions.
57 changes: 25 additions & 32 deletions src/library-authoring/edit-block/LibraryBlock/wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export default function wrapBlockHtmlForIFrame(html, resources, lmsBaseUrl) {
window.edx.StringUtils = StringUtils;
});
</script>
<!--
<!--
commons.js: this file produced by webpack contains many shared chunks of code.
By including this, you have only to also import any of the smaller entrypoint
files (defined in webpack.common.config.js) to get that entry point and all
Expand All @@ -317,49 +317,42 @@ export default function wrapBlockHtmlForIFrame(html, resources, lmsBaseUrl) {
<!-- Built-in XBlocks (and some plugins) depends on LMS CSS -->
<link rel="stylesheet" href="${lmsBaseUrl}/static/css/lms-course.css">
<!-- Configure and load MathJax -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
<script type="text/javascript">
window.MathJax = {
tex: {
inlineMath: [
['\\\\(','\\\\)'],
['[mathjaxinline]','[/mathjaxinline]']
],
displayMath: [
['\\\\[','\\\\]'],
['[mathjax]','[/mathjax]']
]
}
});
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.signal.Interest(function(message) {
if(message[0] === "End Math") {
set_mathjax_display_div_settings();
],
autoload: {
color: [],
colorv2: ['color']
},
packages: {'[+]': ['noerrors']}
},
options: {
ignoreHtmlClass: 'tex2jax_ignore',
processHtmlClass: 'tex2jax_process',
menuOptions: {
settings: {
collapsible: true,
explorer: true
},
},
},
loader: {
load: ['input/asciimath', '[tex]/noerrors']
}
});
function set_mathjax_display_div_settings() {
$('.MathJax_Display').each(function( index ) {
this.setAttribute('tabindex', '0');
this.setAttribute('aria-live', 'off');
this.removeAttribute('role');
this.removeAttribute('aria-readonly');
});
}
</script>
<script type="text/javascript">
// Activating Mathjax accessibility files
window.MathJax = {
menuSettings: {
collapsible: true,
autocollapse: false,
explorer: true
}
};
};
</script>
<!-- This must appear after all mathjax-config blocks, so it is after the imports from the other templates.
It can't be run through static.url because MathJax uses crazy url introspection to do lazy loading of
MathJax extension libraries -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-MML-AM_SVG"></script>
<script type="text/javascript" id="MathJax-script" src="https://cdn.jsdelivr.net/npm/mathjax@3.2.1/es5/tex-mml-svg.js"></script>
`;
}

Expand Down

0 comments on commit 4c8ffde

Please sign in to comment.