fix empty cards not ignoring <br>
https://forums.ankiweb.net/t/bug-report-empty-cards-are-not-recognized/2555
This commit is contained in:
parent
aadc543163
commit
fa46ef9e37
@ -9,6 +9,7 @@ use crate::{
|
|||||||
define_newtype,
|
define_newtype,
|
||||||
err::{AnkiError, Result},
|
err::{AnkiError, Result},
|
||||||
notetype::{CardGenContext, NoteField, NoteType, NoteTypeID},
|
notetype::{CardGenContext, NoteField, NoteType, NoteTypeID},
|
||||||
|
template::field_is_empty,
|
||||||
text::{ensure_string_in_nfc, strip_html_preserving_image_filenames},
|
text::{ensure_string_in_nfc, strip_html_preserving_image_filenames},
|
||||||
timestamp::TimestampSecs,
|
timestamp::TimestampSecs,
|
||||||
types::Usn,
|
types::Usn,
|
||||||
@ -125,7 +126,7 @@ impl Note {
|
|||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.filter_map(|(ord, s)| {
|
.filter_map(|(ord, s)| {
|
||||||
if s.trim().is_empty() {
|
if field_is_empty(s) {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
fields.get(ord).map(|f| f.name.as_str())
|
fields.get(ord).map(|f| f.name.as_str())
|
||||||
|
Loading…
Reference in New Issue
Block a user