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,7 +377,10 @@ function handleTex(tex, fullmatch) {
try {
return katex.renderToString(tex);
} catch (ex) {
return '<span class="tex-error">' + escape(fullmatch) + '</span>';
if (ex.message.startsWith('KaTeX parse error')) { // TeX syntax error
return '<span class="tex-error">' + escape(fullmatch) + '</span>';
}
blueslip.error(ex);
}
}