diff options
Diffstat (limited to 'internal/warpc/js/renderkatex.js')
-rw-r--r-- | internal/warpc/js/renderkatex.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/warpc/js/renderkatex.js b/internal/warpc/js/renderkatex.js index 5c3e18375..5e83beb91 100644 --- a/internal/warpc/js/renderkatex.js +++ b/internal/warpc/js/renderkatex.js @@ -5,7 +5,14 @@ const render = function (input) { const data = input.data; const expression = data.expression; const options = data.options; - writeOutput({ header: input.header, data: { output: katex.renderToString(expression, options) } }); + const header = input.header; + try { + const output = katex.renderToString(expression, options); + writeOutput({ header: header, data: { output: output } }); + } catch (e) { + header.err = e.message; + writeOutput({ header: header }); + } }; readInput(render); |