You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<div class="math math-inline">
… some stuff involving {x} that is interpreted by svelte
</div>
and it produces error as {x} usually comes from a math expression like \sqrt{x} and is not meant to be replaced as a svelte variable. People created a rehype-katex-svelte (as recommended in #302) to solve this issue and this seems to work reasonably well, but I don't know how well maintained this is (e.g. it requires a quite old remark-math, but so do rehype-katex so it might be unrelated) and the author mention some potential security flows. As such, it seems not at battle-tested as rehype-katex.
As such, I was wondering if would instead directly allow users to add in MDsveX (via the options) a list of classes that should be wrapped around {@html } appropriately (with escaping etc) in order not to be interpreted by svelte later in the process. As rehype-katex does not want to do it on their side (see remarkjs/remark-math#104), I see not much other solution, and this might anyway be useful in other scenarios.
The text was updated successfully, but these errors were encountered:
When using
rehype-katex
, it generates text like:and it produces error as
{x}
usually comes from a math expression like\sqrt{x}
and is not meant to be replaced as a svelte variable. People created a rehype-katex-svelte (as recommended in #302) to solve this issue and this seems to work reasonably well, but I don't know how well maintained this is (e.g. it requires a quite old remark-math, but so do rehype-katex so it might be unrelated) and the author mention some potential security flows. As such, it seems not at battle-tested asrehype-katex
.As such, I was wondering if would instead directly allow users to add in
MDsveX
(via the options) a list of classes that should be wrapped around{@html }
appropriately (with escaping etc) in order not to be interpreted by svelte later in the process. As rehype-katex does not want to do it on their side (see remarkjs/remark-math#104), I see not much other solution, and this might anyway be useful in other scenarios.The text was updated successfully, but these errors were encountered: