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
Just to be clear, this is only applicable to remark-html-katex, right? remark-html itself has nothing to do with KaTeX, it's just parsing out LaTeX nodes for remark?
@ibrahima This relates to rehype-katex and remark-html-katex. They both include an HTML parser because KaTeX spits out an HTML string that needs to be transformed into our AST.
I’ve reached out to KaTeX people again and may be able to work on using hast in KaTeX.
Right now remark-math uses KaTeX's
renderToString
method to generate HTML, then reparses it directly afterwards usingrehype-parse
.This is expensive, but was necessary because KaTeX used to not expose their internal AST.
I opened a while ago an issue on their side to expose this AST in order to have better renderers. It seems like now they do. KaTeX/KaTeX#800 (comment)
It would be great if
remark-math
did the conversion from KaTeX's AST to HAST nodes directly, instead of parsing the stringified DOM treeThe text was updated successfully, but these errors were encountered: