Anki add-on: If a note has no more card, warns instead of deleting it

Sometime, you press «Empty cards...», and anki also delete note. Because when a note has no more card, anki deletes it. However, maybe you didn't actually want to delete the whole note and lose its entire content. May be you thought anki were going to delete a few card which became empty, not realizing it will in fact delete EVERY cards, and thus delete the note, and its fields, and its tag... With this add-on, when you press «Empty cards», cards are deleted as usual, with one exception. If deleting the cards leave the note empty, then the cards are not deleted. Instead, the tag NoteWithNoCard is added to those notes, and the browser is opened to show those notes.

GitHub repository: arthur-milchior/anki-keep-empty-note
Repository description: «Empty cards» won't empty notes
Languages: Python