aboutsummaryrefslogtreecommitdiff
path: root/anki-card-template/card.js
diff options
context:
space:
mode:
Diffstat (limited to 'anki-card-template/card.js')
-rw-r--r--anki-card-template/card.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/anki-card-template/card.js b/anki-card-template/card.js
index 00ae0aa..15870fa 100644
--- a/anki-card-template/card.js
+++ b/anki-card-template/card.js
@@ -284,7 +284,8 @@ HTMLElement.prototype.parse = function() {
var out = nodes.map(n => n.data).join("");
this.innerHTML = out;
this.classList.add("parsed");
- if (out.length == 0) this.classList.add("empty");
+ if (nodes.reduce((current, n) => current + (n.type == "text" ? n.data.length : 0), 0) == 0)
+ this.classList.add("empty"); // if innerHTML only contains empty html (no 'user' text)
};
function layout() {