Possible Bug? | Anki's {{type:...}} Field

Hello,

I am currently brushing up on HTML and I’ve decided to use Anki (which was a good decision). I made my own little card design by copying the “Basic (type-in answer)” card type and modifying its CSS.

In the “Basic (type-in answer)” card type, if i type HTML code, it literally messes with the template code when viewing the back of the card.

For example; at the front of card, if i type something like:

á

It will be the result of the HTML entity: (accented letter “a”).

Changing to a different card type doesn’t fix it, and doing something like {{text:type:Back}} also doesn’t do anything.

Also, this doesn’t happen if the answer was incorrect in anyway (wrong/missing letters)

  • Happens on: Windows, Linux and Android
  • Anki version: Just the latest one for Linux
  • Installed extensions: None

Changes the {{type:...}} field makes on the template don’t last when answering the card.

1 Like

Just to make sure, you’re typing á and Anki is converting it to á? If you’re experiencing the opposite (áá), then it’s the normal behaviour I think.

Just to make sure, you’re typing á and Anki is converting it to á?

No, the opposite. It converts HTML entities to the text. This behavior is not specific to HTML entities, it happens with every HTML code.

For example, I have a type-in answer card that asks how to link a tab icon to the page, if you don’t know, this is the code for it:

<link rel="icon" type="image/png" href="icon.png">

If I type this line of code into the front of the type-in answer card type and it’s correct, the back would be empty, and the console will display a 404 not found error (trying to fetch icon.png which doesn’t exist).

2 Likes

I now see the issue. It’s certainly undesirable behaviour of you’re trying to learn HTML.