-
Notifications
You must be signed in to change notification settings - Fork 233
Closed
Description
This is a bit subtle, and I am not entirely sure I have diagnosed the problem correctly, but I am running into a bug in the findMath() function in MathJax3. It appears that having nested elements in a paragraph (for instance, using the <strong> tag) causes premature exiting of the DOM string parser. Here is a minimal example, based upon the mj3-tex2html.html demo:
An HTML document with the following fails:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Testing MathJax v3 setup with TeX input</title>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
<script src="mj3-tex2html.dist.js"></script>
</head>
<body>
<p>This is a <strong>spoiler</strong></p>
<p>
$$ E = mc^2 $$
</p>
</body>
</html>Whereas the following succeeds:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Testing MathJax v3 setup with TeX input</title>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
<script src="mj3-tex2html.dist.js"></script>
</head>
<body>
<p><strong>A spoiler</strong>, this ain't</p>
<p>
$$ E = mc^2 $$
</p>
</body>
</html>
