aboutsummaryrefslogtreecommitdiff
path: root/card/card.js
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-12-26 14:23:17 +0100
committerlonkaars <loek@pipeframe.xyz>2022-12-26 14:23:17 +0100
commit50ba879e537f2a465486d17975714a509461c8dc (patch)
tree3e7a09bdfc4f27e38042d06426ced61cec8a2b44 /card/card.js
parent7ee2d6aa68bfb474f547cf88781fc43b9751d0cc (diff)
small code shuffle to fix AnkiDroid
Diffstat (limited to 'card/card.js')
-rw-r--r--card/card.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/card/card.js b/card/card.js
index ad744b7..e31564f 100644
--- a/card/card.js
+++ b/card/card.js
@@ -30,8 +30,12 @@ function parseSentence(input) {
function run() {
var sentences = document.getElementsByClassName("sentence");
- for (var sentence of sentences)
+ for (var sentence of sentences) {
+ if (sentence.classList.contains("parsed")) continue;
sentence.innerHTML = parseSentence(sentence.innerText);
+ sentence.classList.add("parsed");
+ }
}
run();
+window.onload = () => run();