# Template parsing JavaScript comments

**URL:** <https://forums.ankiweb.net/t/template-parsing-javascript-comments/70534>\
**Category:** Suggestions\
**Created:** [July 25, 2026, 3:01pm UTC](https://forums.ankiweb.net/t/template-parsing-javascript-comments/70534 "2026-07-25T15:01:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Altostratus](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@Altostratus](https://forums.ankiweb.net/u/Altostratus)\
**Post date:** [July 25, 2026, 3:01pm UTC](https://forums.ankiweb.net/t/template-parsing-javascript-comments/70534/1 "2026-07-25T15:01:57Z")

</div>

Hello,

I don’t know if this is a known issue, but I made the mistake of specifying an Anki field in a JavaScript comment, like this:

```auto
// Make sure {{FrontSide}} etc

```

This was part of a HTML script tag inside a card template. It caused a rendering bug which took Claude.ai two hours to (unsuccessfully) debug, until I restored from a backup and realized what was going on.

I suggest idiot-proofing the HTML parser, other idiots like me will probably bump into this at some point.

Thanks.

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [July 25, 2026, 3:11pm UTC](https://forums.ankiweb.net/t/template-parsing-javascript-comments/70534/2 "2026-07-25T15:11:33Z")

</div>

The template parser does not understand HTML/JS syntax - It simply replaces field references.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [August 24, 2026, 3:11pm UTC](https://forums.ankiweb.net/t/template-parsing-javascript-comments/70534/3 "2026-08-24T15:11:54Z")

</div>

Closed on August 24, 2026, 3:11pm UTC

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