Skip to content
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

Don't catch error if throwOnError: true #7

Open
khrykin opened this issue Oct 21, 2016 · 0 comments
Open

Don't catch error if throwOnError: true #7

khrykin opened this issue Oct 21, 2016 · 0 comments

Comments

@khrykin
Copy link

khrykin commented Oct 21, 2016

Hi, many thanks for the library!
Why do we want to catch errors here and here if throwOnError: true is passed — leaving no chance to show error in the UI? I would rather use throw insead of console.logs here and catch error in the outside.

zackw added a commit to zackw/markdown-it-katex that referenced this issue Dec 3, 2022
By default, invoke KaTeX in ‘throwOnError:false‘ mode, so that it will
produce _something_ from any input, and in particular, something which
is guaranteed not to allow any live HTML tags through from the input.
(Unless you are using ‘trust:true‘, in which case you presumably know
what you are doing and why.)

throwOnError:true mode can be re-enabled with plugin options, but then
this plugin will **not** catch any exceptions that are thrown, leaving
recovery up to a higher level.

Since this is a significant behavior change, but one that is more
likely to *fix* bugs in dependent programs than to introce them,
the version number is now 2.1.0.

Fixes waylonflinn#26, waylonflinn#30, and waylonflinn#7.  I would like to thank @khrykin, poster of waylonflinn#7,
for the idea that maybe the exception handlers inside this plugin
should just be completely removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant