Commit aec3e1cc authored by Randall Leeds's avatar Randall Leeds

Merge pull request #2241 from mbbaig/issue1898

Display KaTeX parse error upon faliure to parse
parents a124c259 f873242b
......@@ -313,14 +313,19 @@ module.exports = ['$filter', '$sanitize', '$sce', '$timeout', ($filter, $sanitiz
else
endMath = index
if startMath != null and endMath != null
math = katex.renderToString(textToCheck.substring(startMath, endMath))
textToCheck = (
textToCheck.substring(0, (startMath - 2)) + math +
textToCheck.substring(endMath + 2)
)
startMath = null
endMath = null
return renderInlineMath(textToCheck)
try
math = katex.renderToString(textToCheck.substring(startMath, endMath))
textToCheck = (
textToCheck.substring(0, (startMath - 2)) + math +
textToCheck.substring(endMath + 2)
)
startMath = null
endMath = null
return renderInlineMath(textToCheck)
catch
loadMathJax()
mathJaxFallback = true
$sanitize textToCheck.substring(startMath, endMath)
return textToCheck
# Re-render the markdown when the view needs updating.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment