Skip to content

Commit e3d32a9

Browse files
committed
Remove the script tag processing of MathJax.
The injection of `<script type="math/tex">...</script>` tags by PG is removed by openwebwork/pg#1499. So the script tag handling in the `mathjax-config.js` file is no longer needed.
1 parent 5950f80 commit e3d32a9

1 file changed

Lines changed: 1 addition & 28 deletions

File tree

htdocs/js/MathJaxConfig/mathjax-config.js

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -143,34 +143,7 @@ if (!window.MathJax) {
143143
});
144144
}
145145
},
146-
options: {
147-
renderActions: {
148-
findScript: [
149-
10,
150-
(doc) => {
151-
if (doc.processed.isSet('findScripts')) return;
152-
const containers = doc.adaptor.getElements(doc.options.elements || [doc.document.body], doc);
153-
for (const container of containers) {
154-
for (const node of container.querySelectorAll('script[type^="math/tex"]')) {
155-
const math = new doc.options.MathItem(
156-
node.textContent,
157-
doc.inputJax[0],
158-
!!node.type.match(/; *mode=display/)
159-
);
160-
const text = document.createTextNode('');
161-
node.parentNode.replaceChild(text, node);
162-
math.start = { node: text, delim: '', n: 0 };
163-
math.end = { node: text, delim: '', n: 0 };
164-
doc.math.push(math);
165-
}
166-
}
167-
doc.processed.set('findScripts');
168-
},
169-
''
170-
]
171-
},
172-
ignoreHtmlClass: 'tex2jax_ignore'
173-
},
146+
options: { ignoreHtmlClass: 'tex2jax_ignore' },
174147
output: {
175148
displayOverflow: 'linebreak',
176149
linebreaks: {

0 commit comments

Comments
 (0)