frontend: Show KaTeX errors not related to syntax.

This commit is contained in:
Yago González
2017-03-31 21:01:45 +02:00
committed by Tim Abbott
parent c1fea74a65
commit 8f8efb4664

View File

@@ -377,8 +377,11 @@ function handleTex(tex, fullmatch) {
try {
return katex.renderToString(tex);
} catch (ex) {
if (ex.message.startsWith('KaTeX parse error')) { // TeX syntax error
return '<span class="tex-error">' + escape(fullmatch) + '</span>';
}
blueslip.error(ex);
}
}
function python_to_js_filter(pattern, url) {