I use QWebEngineView to convert Markdown to HTML and render the math formula via MathJax. All the content are inside a <div id="placeholder">. Then I use document.getElementById("placeholder").innerHTML to get the HTML content, which contains the converted Markdown content and rendered MathJax output. At last, I output the HTML content to a HTML file.
However, when I open the exported HTML file via Chrome, the formulas lose the CSS styles like this demo.
So any idea to make the formulas in order?
I have tried to add MathJax script to the exported HTML but the formulas will disappear.
Thanks!