<html><head><script>
document.addEventListener("DOMContentLoaded", function() {
// Uncommenting this makes the loading succeed. It must be a div, e.g. a table does not help.
//document.body.appendChild(document.createElement('div'));
let script = document.createElement('script');
script.src = "https://cdn.jsdelivr.net/npm/mathpix-markdown-it@1.3.8/es5/bundle.js";
script.onload = function() { window.loadMathJax(); };
document.head.append(script);
});
</script></head><body></body></html>
with the error:
Error load MathJax => Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
it fails in this place in the bundle.js:
if (!document.getElementById("SVG-styles")) {
var s = u.MathJax.Stylesheet();
document.head.appendChild(s)
}
apparently, in the error case, s is not an html node, after adding a div node to the body (the commented line), it becomes a proper html node.
I'm not blocked by this (workaround is commented out), but found it a strange situation and hard to find the error, so I believe this should be fixed.
Hello,
it may seem strange, but this fails:
with the error:
it fails in this place in the
bundle.js
:apparently, in the error case,
s
is not an html node, after adding adiv
node to the body (the commented line), it becomes a proper html node.I'm not blocked by this (workaround is commented out), but found it a strange situation and hard to find the error, so I believe this should be fixed.