`<` in html markup will corrupt the card

Steps to recreate the issue:

  1. start by add a new card to your deck
  2. the front text does not matter, for example set it to front
  3. for the back text, toggle the html editr. then paste j<i in the html editor’s field.
  4. press the add button
  5. close the add window
  6. go to study mode and review the newly added card and show the answer
  7. you’ll see this:
    image
    (you can already see that the source of the card (j) does not match the displayed text (j<i))
  8. go to edit mode and blank the back text and close
  9. You’ll see that although you’ve cleared the back of the card, the letter j is still showing up in the back:
    image

This is the simplest example I could come up with. In more complicated cards you’ll see that the output of a card is rendered incorrectly. For example mathjax blocks after &lt; will not be rendered at all. Has caused me a lot of confusion. Hope someone can fix it.

I’m using Version ⁨2.1.62 (77dd1dc1)⁩ but this problem has existed at least in the past several versions.

Please follow the steps on When problems occur - Frequently Asked Questions

  • restarting anki does not help.
  • i have no active addons installed right now
  • i update anki to latest version Version <U+2068>2.1.64 (581f82c5)<U+2069> Python 3.9.15 Qt 6.4.3 PyQt 6.4.0 and still the same thing happens
  • database “rebuilt and optimized”
  • computer restart did not help
  • changing the gldriver from auto to software did help either

I do not have this issue
image

1 Like

I tested again on a new profile. The issue does not exist in the new one. Something must be wrong with my profile then.

I don’t fully understand the problem. So I don’t know if this is relevant. But whenever there’s additional stuff in the reviewer/previewer that’s not visible in the editor I think you of Extra characters appearing on cards - Frequently Asked Questions

1 Like

I can’t reproduce the issue either. Are you sure no add-ons were active? If you disabled them via the add-on screen, did you restart Anki?

1 Like

Thanks guys for trying to help me.

I could successfully reproduce the problem in my new profile after creating a new template, so please take these extra steps and see if you can reproduce:

  1. add a new field named “Tip”
  2. change front template to:
{{Front}}
{{type:Back}}
  1. change back template to:
{{FrontSide}}
<hr id=answer>
{{Back}}
<hr>
{{Tip}}
  1. change styling to:
styling:
.card {
 font-family: 'JetBrains Mono';
 font-size: 18px;
 text-align: left;
 background-color: white;
}
  1. save and retry the steps in OP.

There are no add-ons listed in add-on:


Restart does not help. Is there somewhere else I should check?

I created a notetype with those exact specs, and still can’t seem to reproduce the problem I’m afraid.

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