mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
catch exceptions when setting HTML
thanks to Alicia for the original solution:
dee4c98e9b
This commit is contained in:
parent
13b331fb0a
commit
db5d23d9dc
1 changed files with 5 additions and 1 deletions
|
@ -9,7 +9,11 @@ function _updateQA(html, fadeTime, onupdate, onshown) {
|
||||||
var qa = $("#qa");
|
var qa = $("#qa");
|
||||||
qa.fadeTo(fadeTime, 0, function() {
|
qa.fadeTo(fadeTime, 0, function() {
|
||||||
// update text
|
// update text
|
||||||
qa.html(html);
|
try {
|
||||||
|
qa.html(html);
|
||||||
|
} catch(err) {
|
||||||
|
qa.text("Invalid HTML on card: "+err);
|
||||||
|
}
|
||||||
_removeStylingFromMathjaxCloze();
|
_removeStylingFromMathjaxCloze();
|
||||||
onupdate(qa);
|
onupdate(qa);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue