[BUG] Duplicates not detecting on paste

I have a list of words without genders in French, so I’m slowly adding them one by one into my Anki deck. I’ve noticed, though, that duplicate detection doesn’t always function when I’d expect it to (click here for the images, since I can only post two links):

  1. Create a card with front “le vin,” done by typing it in directly and assuring that the HTML editor says only those two words with no artifacts. (Image #1.)

  2. Make a new card, typing “le vin” in again (with no artifacts). The duplicate detection functions as intended. (Image #2.)

  3. Make another new card, done by typing in "le " and then copying the word “vin” from somewhere else and pasting it in (so far I’ve tested with Chrome/Firefox/Excel but I’m sure it’s similar for any source material). This time, no duplicates are found. (Image #3.)

Upon inspection of the HTML, we find that indeed, a non-breaking space has replaced our previous normal space (Image #4.)

Now, the addition of non-breaking spaces in Anki is a known issue (see /r/Anki/comments/ea80dx/nbsp_misery/), but that is not the purpose of this post. No, the issue is the lack of duplicate detection in spite of the differing spaces, which was at one point operational.

Issue present in Anki 2.1.37.

1 Like

@abdo are you interested in looking into this? It looks like strip_html_preserving_media_filenames() should be calling decode_entities()

2 Likes

I’ve sent a pull request:

2 Likes