mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
field_checksum needs to strip HTML
This commit is contained in:
parent
4f93ae4b6d
commit
68657c7166
1 changed files with 3 additions and 2 deletions
|
@ -40,8 +40,9 @@ impl Note {
|
|||
}
|
||||
}
|
||||
|
||||
fn field_checksum(text: &str) -> u32 {
|
||||
let digest = sha1::Sha1::from(text).digest().bytes();
|
||||
pub(crate) fn field_checksum(text: &str) -> u32 {
|
||||
let text = strip_html_preserving_image_filenames(text);
|
||||
let digest = sha1::Sha1::from(text.as_ref()).digest().bytes();
|
||||
u32::from_be_bytes(digest[..4].try_into().unwrap())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue