Stop throwing ParseError when throwOnError is false (#1169)

* Stop throwing ParseError when throwOnError is false

`render`, `renderToString`, etc. now catch ParseError and render it to the
raw LaTeX (with proper escaping) and a hover title with the error.

Along the way:
* Use new `katex.__renderToDomTree` in katex-spec's `_getBuilt`.
  (This was necessary to get the new error handling in `_getBuilt`.)
* Fix jest results which must always be functions, not strings.

* fix lint

* Fix flow error

Leave error type unspecified, as we check it with instanceof.

* Update katex-spec.js
This commit is contained in:
Erik Demaine
2018-05-09 09:18:50 -04:00
committed by ylemkimon
parent 3e529dd5a0
commit 49e673a59c
4 changed files with 94 additions and 15 deletions

View File

@@ -14,7 +14,7 @@ function init() {
input.addEventListener("input", reprocess, false);
permalink.addEventListener("click", setSearch);
const options = {displayMode: true, macros: {}};
const options = {displayMode: true, throwOnError: false, macros: {}};
const query = queryString.parse(window.location.search);
if (query.text) {