From fa46ef9e377bb39160ab6fcfafcb10b2adc8acea Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 23 Aug 2020 11:44:49 +1000 Subject: [PATCH] fix empty cards not ignoring
https://forums.ankiweb.net/t/bug-report-empty-cards-are-not-recognized/2555 --- rslib/src/notes.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rslib/src/notes.rs b/rslib/src/notes.rs index 9a1256c5a3b..657b0750bb3 100644 --- a/rslib/src/notes.rs +++ b/rslib/src/notes.rs @@ -9,6 +9,7 @@ use crate::{ define_newtype, err::{AnkiError, Result}, notetype::{CardGenContext, NoteField, NoteType, NoteTypeID}, + template::field_is_empty, text::{ensure_string_in_nfc, strip_html_preserving_image_filenames}, timestamp::TimestampSecs, types::Usn, @@ -125,7 +126,7 @@ impl Note { .iter() .enumerate() .filter_map(|(ord, s)| { - if s.trim().is_empty() { + if field_is_empty(s) { None } else { fields.get(ord).map(|f| f.name.as_str())