showdown-katex
showdown-katex copied to clipboard
"not equal sign" didn't render properly
When I tried to write \ne
in latex format or !=
in asciimath format, the strike in the equal sign was misaligned. This happen even on the demo page on https://obedm503.github.io/showdown-katex/#sandbox
I've confirmed this is an issue. I tried quickly figuring out what may be causing it, but have not been able to. It seems to be related to KaTeX/KaTeX#1842. Any help is appreciated.
Until this issue is fixed, you can use \cancel{=}
instead (even in asciimath blocks).
What browser and OS are you using?
It's interesting that if we use renderMathInElement
from katex directly, this error doesn't seem to occur.
@lriuui0x0 can you provide some more details? you mentioned using renderMathInElement
directly, but this package already uses renderMathInElement
I've been looking into this issue without much success. how did you get renderMathInElement
to work?
@obedm503 Yep I had code like below to render maths. code.math
is the class that's assigned when you do ```math with showdown.
Array.from(text_root.querySelectorAll('code.math')).forEach(code => {
let p = document.createElement('p');
katex_html = katex.renderToString(code.innerText, {
displayMode: true,
throwOnError: false,
});
p.innerHTML = katex_html;
code.replaceWith(p);
});
renderMathInElement(text_root, {
throwOnError: false,
delimiters: [
{left: "$", right: "$", display: false},
]
});
what version of katex are you using?
@obedm503 Latest. I'm using <script src="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.js"></script>