-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rehype-katex
does not catch non-parse errors
#82
Comments
Errors happen. You can handle errors: https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary |
This comment has been minimized.
This comment has been minimized.
@wooorm ?????? I know the error boundry, if I use rehype-mathjax, the syntax error is handled inside mathjax to tell users that math block is wrong WITHOUT breaking render of legal markdown code, but it's impossible to implement this in rehype-katex via error boundry. this error will break whole react-markdown renderer. |
I don’t know what you want. |
This comment has been minimized.
This comment has been minimized.
rehype-katex
does not catch non-parse errors
Initial checklist
Affected packages and versions
5.1.1
Link to runnable example
https://codesandbox.io/s/markdown-editor-with-katex-forked-x63zo4
Steps to reproduce
use invalid latex code with rehypeKatex and react-markdown:
Expected behavior
invalid latex code is displayed with red color
here is a fixed version of rehypeKatex that has expected behavior:
Actual behavior
element crash.
Runtime
No response
Package manager
No response
OS
No response
Build and bundle tools
No response
The text was updated successfully, but these errors were encountered: