# Minor bug: \`\[...\]\` and \`\[...\]+\` buttons break HTML formatting

**URL:** <https://forums.ankiweb.net/t/minor-bug-and-buttons-break-html-formatting/40695>\
**Category:** Help\
**Created:** [February 3, 2024, 8:35pm UTC](https://forums.ankiweb.net/t/minor-bug-and-buttons-break-html-formatting/40695 "2024-02-03T20:35:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![badlydrawnrob](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@badlydrawnrob](https://forums.ankiweb.net/u/badlydrawnrob)\
**Post date:** [February 3, 2024, 8:35pm UTC](https://forums.ankiweb.net/t/minor-bug-and-buttons-break-html-formatting/40695/1 "2024-02-03T20:35:14Z")

</div>

It’s a minor thing, but a little frustrating. For instance, a piece of code like this:

```html
<span><span>some content</span></span>

```

Selecting this text and hitting one of the cloze deletion buttons places the `{{c1::cloze tag}}` **outside** the parent `<span>`. This means it breaks formatting for CSS.

You can [see a video of the problem here](https://github.com/badlydrawnrob/anki/issues/132). I understand if it’s not something fixable, but thought I’d point it out.

Typing out the cloze deletion tag manually seems to cure the problem.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [February 5, 2024, 9:51am UTC](https://forums.ankiweb.net/t/minor-bug-and-buttons-break-html-formatting/40695/2 "2024-02-05T09:51:09Z")

</div>

I’ve logged this on [Manipulate the DOM when creating cloze deletions? · Issue #2991 · ankitects/anki · GitHub](https://github.com/ankitects/anki/issues/2991)

---

<div class="post-metadata">

**Author:** ![badlydrawnrob](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@badlydrawnrob](https://forums.ankiweb.net/u/badlydrawnrob)\
**Post date:** [February 7, 2024, 1:51pm UTC](https://forums.ankiweb.net/t/minor-bug-and-buttons-break-html-formatting/40695/3 "2024-02-07T13:51:44Z")

</div>

Great. So it’s a known issue. I’m sure there are a good number of issues to look at so appreciate it.

It’s strange that typing in the cloze deletion manually (a least so far in my tests) doesn’t do that. I’d _love_ to be able to just add it to a fenced code block like this:

```auto
{{c1::(functionCall number string)::what is this function called?}}

```

And compile it with Pandoc. It compiles, but Anki complains that there’s no cloze deletion been added.

I’m guessing text manipulation is a hard problem to solve.

---

<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:** [March 8, 2024, 1:52pm UTC](https://forums.ankiweb.net/t/minor-bug-and-buttons-break-html-formatting/40695/4 "2024-03-08T13:52:04Z")

</div>

Closed on March 8, 2024, 1:52pm UTC

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