ssssota / svelte-exmarkdown

Svelte component to render markdown.
https://ssssota.github.io/svelte-exmarkdown
MIT License
177 stars 6 forks source link

`\vec{}` and `\sqrt{}` do not render with the given KaTeX example code #123

Closed StevenClontz closed 8 months ago

StevenClontz commented 9 months ago

If you try to add a vector or square root at https://ssssota.github.io/svelte-exmarkdown/docs/08-math-formula using \vec or \sqrt, the math is not typeset with an arrow or square root symbol.

ssssota commented 9 months ago

Thank you for the report!

I have confirmed the bug! SVG does not seem to be rendering.

StevenClontz commented 9 months ago

A possible hint: when our page https://scholarlattice.pi-base.org/markdown is loaded, you see the square root for a brief moment before it disappears.

StevenClontz commented 9 months ago

I also added a vector to the sample text on that page to demonstrate that issue. Interestingly, the vector arrow does not flash on screen at all (and doesn't seem to be drawn as an SVG).

ssssota commented 9 months ago

I have checked this bug.

svelte-exmarkdown uses <svelte:element /> internally. It seems that elements such as SVG path are not properly setting Namespace (http://www.w3.org/2000/svg).

StevenClontz commented 9 months ago

Is there a solution here? https://github.com/sveltejs/svelte/issues/7613

ssssota commented 8 months ago

Sorry for the delay in responding. A fixed version has been released! https://github.com/ssssota/svelte-exmarkdown/releases/tag/v3.0.3

StevenClontz commented 8 months ago

Thanks so much. I can confirm fixes \sqrt rendering at https://scholarlattice.pi-base.org/markdown

I'm still dealing with \vec rendering not appearing on that page. However, \vec looks fine when I try it at https://ssssota.github.io/svelte-exmarkdown/docs/08-math-formula So I assume it's a bug in my CSS or similar, and not an issue here.

Thanks again!