Hi everyone!
To create a card template, I’m using inline SVG and within that I’m using JavaScript to paint parts of the SVG in different colors according to given conditions.
For that, I need to use if-statements and in particular the ‘less than’ operator <
.
While working on the card template, I have a copy of it in a seperate .svg file on my computer, which I view with my internet browser for testing and debugging.
I know I can’t use the <
character within HTML without escaping or substituting it somehow. So, I have tried the combinations <
or <
. In my testing file, viewed with my browser, both versions work as expected. In Anki, they don’t.
Enclosing the whole script content like so:
<script><![CDATA[
...
if (x < y) {
...
}
...
]]></script>
also works in my testing file in my browser, but not in Anki.
In the Anki editor, I also tried the other comparison operators ==
and !=
whithin the if-statements and there, everything works as expected.
So the problem at this point is definitely only with the two characters <
and >
in Anki.
Does anyone know how to use them in the Anki card editor?