# Error in text comparison highlighting (type: card)

**URL:** <https://forums.ankiweb.net/t/error-in-text-comparison-highlighting-type-card/40643>\
**Category:** Help\
**Created:** [February 2, 2024, 4:30pm UTC](https://forums.ankiweb.net/t/error-in-text-comparison-highlighting-type-card/40643 "2024-02-02T16:30:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Nick](https://forums.ankiweb.net/u/Nick)\
**Post date:** [February 2, 2024, 4:30pm UTC](https://forums.ankiweb.net/t/error-in-text-comparison-highlighting-type-card/40643/1 "2024-02-02T16:30:24Z")

</div>

![Anki Highlighting Error](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/d/1/d181562b26b41f85f38fe24f361af9becc7e54e3.png)

I incorrectly put an “i” at the end of the third word in this list (incorrect _hnífi_ instead of correct _hníf_)\*, but the highlighter didn’t mark it as incorrect.

I have noticed this problem on a few other occasions, always with “i”, never with any other character.

\*Actually, in Icelandic, both _hníf_ and _hnífi_ are correct, but that’s not the point here. I’m just using this as an example to point out a bug. The “correct” answer on my card is _hníf_.

---

<div class="post-metadata">

**Author:** ![Danika\_Dakika](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/danika_dakika/32/17815_2.png) [@Danika\_Dakika](https://forums.ankiweb.net/u/Danika_Dakika)\
**Post date:** [February 3, 2024, 7:39pm UTC](https://forums.ankiweb.net/t/error-in-text-comparison-highlighting-type-card/40643/2 "2024-02-03T19:39:21Z")

</div>

Is it always with `fi`? What I noticed right away is that the one you typed uses a `fi` “ligature” character – not truly `f` then `i`.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/7/0/70fa5408bd10c0a74fd2e88572bd586d2f3a1478.png)

I have come to hate ligatures – because in many fonts they make it impossible to distinguish dotted-i (“fi”) from undotted-ı (“fı”). However, in my research, I’ve never needed to figure out how they work for comparisons. 🤷🏽 Is it just a visual change, and the word is still a separate f and i? Or is the fi-ligature considered a version of the f character? Or does it vary from font-to-font and implementation-to-implementation?

What I can tell you is that [adding this to your Styling](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-ligatures) thankfully makes ligatures go away.

> `font-variant-ligatures: no-common-ligatures;`

So you could test pretty quickly if a card like that still accepts this typo without the ligature.

---

<div class="post-metadata">

**Author:** ![Nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Nick](https://forums.ankiweb.net/u/Nick)\
**Post date:** [February 4, 2024, 10:47am UTC](https://forums.ankiweb.net/t/error-in-text-comparison-highlighting-type-card/40643/3 "2024-02-04T10:47:10Z")

</div>

Good thinking! I think you’re exactly right. The following two test cases seem to prove it:

![Screenshot 2024-02-04 at 11.44.22 AM](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/c/f/cfb2fd0071cd5d8bd00efd70b0536169a144e66d.png)  
 ![Screenshot 2024-02-04 at 11.44.34 AM](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/4/6/4611074d83aa58b7ddcaed97dc8b554228ccee97.png)

Where exactly do I find the Styling that I can add your command to? (I’ll keep looking around, but I haven’t been able to find it yet.)

---

<div class="post-metadata">

**Author:** ![Danika\_Dakika](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/danika_dakika/32/17815_2.png) [@Danika\_Dakika](https://forums.ankiweb.net/u/Danika_Dakika)\
**Post date:** [February 4, 2024, 4:56pm UTC](https://forums.ankiweb.net/t/error-in-text-comparison-highlighting-type-card/40643/4 "2024-02-04T16:56:00Z")

</div>

“Cards…” from the top of the editor window, or “Manage Note Types \> Cards” from anywhere else. You’ll see front/back templates for each card, and “Styling” that applies to the whole note type. [Styling & HTML - Anki Manual](https://docs.ankiweb.net/templates/styling.html)

I’ll be curious to know if that fixes it!

---

<div class="post-metadata">

**Author:** ![Nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Nick](https://forums.ankiweb.net/u/Nick)\
**Post date:** [February 5, 2024, 5:44pm UTC](https://forums.ankiweb.net/t/error-in-text-comparison-highlighting-type-card/40643/5 "2024-02-05T17:44:20Z")

</div>

That worked perfectly! Thank you for your help!

Here’s a screenshot in case it would be helpful to anyone having the same problem.

 ![Screenshot 2024-02-05 at 6.43.10 PM](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/b/c/bc445a2dbfabd3ece3db2e76a41d583a5d30c1a0.png)

---

<div class="post-metadata">

**Author:** ![Danika\_Dakika](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/danika_dakika/32/17815_2.png) [@Danika\_Dakika](https://forums.ankiweb.net/u/Danika_Dakika)\
**Post date:** [February 5, 2024, 9:01pm UTC](https://forums.ankiweb.net/t/error-in-text-comparison-highlighting-type-card/40643/6 "2024-02-05T21:01:45Z")

</div>

Nifty!

If the comparison is being fooled by ligature characters – this is probably one that @dae should take a look at. It might be a limitation of the underlying fonts or libraries, in which case it seems like some sort of caution should be documented for folks using `code#typeans` to change the font.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [February 6, 2024, 4:19am UTC](https://forums.ankiweb.net/t/error-in-text-comparison-highlighting-type-card/40643/7 "2024-02-06T04:19:38Z")

</div>

Could I trouble you to post a minimum reproducible example on the issue tracker?

---

<div class="post-metadata">

**Author:** ![Danika\_Dakika](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/danika_dakika/32/17815_2.png) [@Danika\_Dakika](https://forums.ankiweb.net/u/Danika_Dakika)\
**Post date:** [February 6, 2024, 5:46am UTC](https://forums.ankiweb.net/t/error-in-text-comparison-highlighting-type-card/40643/8 "2024-02-06T05:46:42Z")

</div>

I think we can make that happen. 👍🏽

@Nick I’m DMing you.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [March 7, 2024, 5:47am UTC](https://forums.ankiweb.net/t/error-in-text-comparison-highlighting-type-card/40643/9 "2024-03-07T05:47:03Z")

</div>

Closed on March 7, 2024, 5:47am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
