Card generation different from manual

I wanted to create unit test for the new card generation. To be sure I understand them before porting them to AnkiDroid.

I used
"
{{A}}
{{#B}}
{{#C}}
{{B}}
{{/C}}
{{/B}}
"
which according to the manual is a limitation of old anki. I’m using 2.1.29 and master, and in both case, if I just add “B” and nothing else, the card is generated. It is shown as having an empty front, but still generated, which should not occur.

Same problem if I only fill C

{{^AddIfEmpty}}
{{Front}}
{{/AddIfEmpty}}
is generated even if both fields are empty
(To be able to generate the card without add-on, I added a first field, “first” which does not appear in the template but which I left filled, this way the note is not rejected because of the empty field

This was covered in the change notes, and I have just added it to the manual as well.

https://docs.ankiweb.net/#/templates/generation?id=adding-empty-notes

1 Like

I like this behavior as it gives more options and supports the idea of multi-step workflows.

I really LOVE this change. Thank you very much. I guess I’ll deprecate my add-on that ensure that “empty card” does not delete all cards of a note. (Not that it still works)
It’s really cool in general how many add-ons I was able to remove because they are core feature.

Can’t wait to port it to ankidroid.

2 Likes