Broken JavaScriptafter updating

Hello, the JavaScript on my template breaks after updating. To demonstrate what I mean, we can use the Basic card type with a simplified version of what I am experiencing. The card can have anything on the front and the back.

The following is the back template.

<span id="abcd">
{{FrontSide}}
<hr id=answer>

{{Back}}
<span id="abcd">
<script>
document.getElementById("abcd").innerHTML = "";
</script>

As you can see, document.getElementById(“abcd”).innerHTML = “” should replace the whole back template with “” and that is exactly what it does.
However, my problem comes when you try to add almost anything else. Let’s just add 2 more lines.

<span id="abcd">
{{FrontSide}}
<hr id=answer>

{{Back}}
<span id="abcd">
<script>
const HIRAGANA_START = 0x3041;
const HIRAGANA_END = 0x3096;
document.getElementById("abcd").innerHTML = "";
</script>

Now, the JavaScript is completely broken and the whole black template is not replaced with “”. I was previously using 2.1.35 and I updated to use

Version <U+2068>23.12.1 (1a1d4d54)<U+2069>
Python 3.9.15 Qt 6.6.1 PyQt 6.6.1

What is the problem here?

Maybe try checking this:

1 Like

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