catch exceptions when setting HTML

thanks to Alicia for the original solution:
dee4c98e9b
This commit is contained in:
Damien Elmes 2017-08-17 20:02:28 +10:00
parent 13b331fb0a
commit db5d23d9dc

View File

@ -9,7 +9,11 @@ function _updateQA(html, fadeTime, onupdate, onshown) {
var qa = $("#qa");
qa.fadeTo(fadeTime, 0, function() {
// update text
qa.html(html);
try {
qa.html(html);
} catch(err) {
qa.text("Invalid HTML on card: "+err);
}
_removeStylingFromMathjaxCloze();
onupdate(qa);