Anki Forums

Template corruption in Anki 2.1.47

I was editing the CSS of a Basic (and reversed card) deck today.

My process was:

  1. Edit CSS code in the Styling editor.
  2. Click Save button after a sizeable edit.
  3. Occasionally check the card using the Preview button.
  4. Goto 1.

After about an hour, something weird happened, the HTML code in the front and back editors for Card 1 copied over to (ie. replaced) the front and back code for Card 2. I only realised because the preview was showing the question side of each card in the same language.

But I did not do any editing in the HTML template editors. Only the CSS (Styling) editor.

I retrieved my original HTML code from a backup, and that fixed the problem.

I’m trying to understand what happened because I’m convinced it wasn’t due to user error. I was not editing the HTML at all and copy/pasting code from both front and back of one card to the other is not exactly an easy mistake to make.

Thanks.

Did you rule out add-ons? When problems occur - Frequently Asked Questions

I try to avoid add-ons. The only ones I use are Review Heatmap and HTML Window source and they have been installed for a couple of years. During that time I have extensively edited the HTML and CSS without issues.

I think only Review Heatmap writes to the database, but I’ve never heard of it causing an issue like this before. HTML Window source doesn’t seem to hook into the Cards editor.

I spent another hour editing the CSS this morning without problems, so whatever caused this problem - I suspect it’s going to be difficult to replicate.

I can’t think of a reason why that would happen, and recent Anki versions should actually refuse to save notetypes with duplicate templates. If you are able to reproduce it again in the future and spot a pattern, please let us know.

1 Like

Thanks for replying. Your feedback is very reassuring. I’ll definitely let you know if it happens again.