We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 92dd247 commit c144942Copy full SHA for c144942
web_src/js/markup/math.js
@@ -23,12 +23,14 @@ export async function renderMath() {
23
24
for (const el of els) {
25
const source = el.textContent;
26
- const options = {display: el.classList.contains('display')};
+ const nodeName = el.classList.contains('display') ? 'p' : 'span';
27
28
try {
29
- const markup = katex.renderToString(source, options);
30
- const tempEl = document.createElement(options.display ? 'p' : 'span');
31
- tempEl.innerHTML = markup;
+ const tempEl = document.createElement(nodeName);
+ katex.render(source, tempEl, {
+ maxSize: 25,
32
+ maxExpand: 50,
33
+ });
34
targetElement(el).replaceWith(tempEl);
35
} catch (error) {
36
displayError(el, error);
0 commit comments