Add temporary config for mathjax
This commit is contained in:
parent
756e4749c9
commit
51a8400fa5
1 changed files with 26 additions and 0 deletions
|
@ -76,5 +76,31 @@
|
||||||
{% block bodyend %}
|
{% block bodyend %}
|
||||||
{% if REQUIRE_JAX %}
|
{% if REQUIRE_JAX %}
|
||||||
{% include "mathjax-load.html" %}
|
{% include "mathjax-load.html" %}
|
||||||
|
<script>
|
||||||
|
// TODO: remove this
|
||||||
|
window.MathJax = {
|
||||||
|
options: {
|
||||||
|
ignoreHtmlClass: 'tex2jax_ignore',
|
||||||
|
processHtmlClass: 'tex2jax_process',
|
||||||
|
renderActions: {
|
||||||
|
find: [10, function (doc) {
|
||||||
|
for (const node of document.querySelectorAll('script[type^="math/tex"]')) {
|
||||||
|
const display = !!node.type.match(/; *mode=display/);
|
||||||
|
const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display);
|
||||||
|
const text = document.createTextNode('');
|
||||||
|
const sibling = node.previousElementSibling;
|
||||||
|
node.parentNode.replaceChild(text, node);
|
||||||
|
math.start = {node: text, delim: '', n: 0};
|
||||||
|
math.end = {node: text, delim: '', n: 0};
|
||||||
|
doc.math.push(math);
|
||||||
|
if (sibling && sibling.matches('.MathJax_Preview')) {
|
||||||
|
sibling.parentNode.removeChild(sibling);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, '']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue