From 3613885da1dd5d0fda0e2c35317938d598d02b6a Mon Sep 17 00:00:00 2001 From: Erik Demaine Date: Wed, 9 May 2018 10:11:33 -0400 Subject: [PATCH] Document new error handling behavior (renderOnError) (#1302) PR #1169 forgot to document itself. This fixes the README accordingly. --- README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f00133df..99035225 100644 --- a/README.md +++ b/README.md @@ -54,22 +54,25 @@ all of KaTeX. #### Handling errors -If KaTeX encounters an error (invalid or unsupported LaTeX), then it will -throw an exception of type `katex.ParseError`. The message in this error -includes some of the LaTeX source code, so needs to be escaped if you want -to render it to HTML. In particular, you should convert `&`, `<`, `>` -characters to `&`, `<`, `>` (e.g., using `_.escape`) +If KaTeX encounters an error (invalid or unsupported LaTeX) and `throwOnError` +hasn't been set to `false`, then it will throw an exception of type +`katex.ParseError`. The message in this error includes some of the LaTeX +source code, so needs to be escaped if you want to render it to HTML. +In particular, you should convert `&`, `<`, `>` characters to +`&`, `<`, `>` (e.g., using `_.escape`) before including either LaTeX source code or exception messages in your HTML/DOM. (Failure to escape in this way makes a `