How to fix Anki replacing `>` by `>`?

Hey, I use markdown rendering in Anki to easily create my cards.

One problem I noticed since the new update is that greater than signs > are now automatically converted to the HTML encoding of > which looks identical, but breaks the markdown rendering of block quotes.

Note: This problem occurs specifically in the “source code” of the cards, the normal rendering appears to be identical.

Does anyone have any idea on how to stop Anki from thing doing this, or replace the characters back somewhere in card rendering?

Below is some of the “investigation” I have done thus far.

How I identified the problem is in Anki:
Firstly zero-md and most of its dependents have not been updated in a while, and the problem is recent.
The only recently updated dependent package is marked, which has demo on its website where block quotes function as normal.

Opening the card source code section it becomes visible that > has been replaced with >. Changing it back to > persists only as long as the screen is in focus, once I click eg. previeuw, it reverts to >

Current setup:
I use zero-md in my card templates to render my markdown, a simple example is:

<script type="module" src="https://cdn.jsdelivr.net/npm/zero-md@3?register"></script>



<zero-md>

<script type="text/markdown">

{{Front}}

</script>

</zero-md>

Not sure why you are saying this is a last update issue. Anki always stored field contents as HTML. Representing < and > with &lt; and &gt; in the source is a core part of the language, otherwise they would be confused with tag brackets.

If you are looking for a practical method of storing non-html code in note fields, using JS to retrieve textContent is the conventional way.

Apologies, the issue seemed new to me, but maybe its because it does not exist on Mobile, after testing older versions that indeed was not it.

For anyone else stumbling upon it, I have fixed it through using the following:


<!-- Invisibly store {{FIELD_NAME}} here as raw text outside any JS context -->

<div id="rawContent" hidden>{{Front}}</div>



<zero-md>
<script id="mdText" type="text/markdown"></script>
</zero-md>


<script type="module">
import 'https://cdn.jsdelivr.net/npm/zero-md@3?register';

document.getElementById('mdText').textContent = document.getElementById('rawContent').textContent;

</script>