# Button to Insert HTML at selected text

**URL:** <https://forums.ankiweb.net/t/button-to-insert-html-at-selected-text/23922>\
**Category:** Suggestions\
**Created:** [October 15, 2022, 1:36pm UTC](https://forums.ankiweb.net/t/button-to-insert-html-at-selected-text/23922 "2022-10-15T13:36:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hmor](https://avatars.discourse-cdn.com/v4/letter/h/bb73d2/32.png) [@hmor](https://forums.ankiweb.net/u/hmor)\
**Post date:** [October 15, 2022, 1:36pm UTC](https://forums.ankiweb.net/t/button-to-insert-html-at-selected-text/23922/1 "2022-10-15T13:36:36Z")

</div>

I would like to suggest a feature present in AnkiDroid.  
You can create toolbar buttons to add custom HTML(or text) before and after the selection.

As shown in the picture below

 ![Screenshot_20221015-103113](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/c/c0d6501efecd10332c9bcb7cc23a5bdcdd1dde5a.png)

Thanks

---

<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:** [October 17, 2022, 1:28am UTC](https://forums.ankiweb.net/t/button-to-insert-html-at-selected-text/23922/2 "2022-10-17T01:28:34Z")

</div>

The plan is to eventually integrate the desktop editor into the mobile clients, so this would need to come to the desktop first.

---

<div class="post-metadata">

**Author:** ![hmor](https://avatars.discourse-cdn.com/v4/letter/h/bb73d2/32.png) [@hmor](https://forums.ankiweb.net/u/hmor)\
**Post date:** [October 17, 2022, 2:25am UTC](https://forums.ankiweb.net/t/button-to-insert-html-at-selected-text/23922/3 "2022-10-17T02:25:48Z")

</div>

I see. Thanks!

I would suggest as alternative an option to do not increment the cloze number. That’s my use case.

It exists as a desktop shortcut. On mobile it could be a configuration option to enable/disable the increment.

it’s tedious to change all the numbers one by one.

---

<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:** [October 17, 2022, 5:06am UTC](https://forums.ankiweb.net/t/button-to-insert-html-at-selected-text/23922/4 "2022-10-17T05:06:25Z")

</div>

A long press on the cloze icon will add another with the same number.

---

<div class="post-metadata">

**Author:** ![Kazue](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@Kazue](https://forums.ankiweb.net/u/Kazue)\
**Post date:** [January 17, 2025, 7:31am UTC](https://forums.ankiweb.net/t/button-to-insert-html-at-selected-text/23922/5 "2025-01-17T07:31:00Z")

</div>

May I bring this up again?

How would I go about proposing that such a function be added to Anki Desktop (add a toolbar item to add some user-defined html before and after the selected text that you can click, just like bold or italics)? I’m using it to mark some of my text with a different div class in a field, so having to manually type it out everytime in Anki Desktop is a bit tedious.

I also tried searching around for an addon that would let me add such a function, but couldn’t find anything.

---

<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:** [January 18, 2025, 7:08am UTC](https://forums.ankiweb.net/t/button-to-insert-html-at-selected-text/23922/6 "2025-01-18T07:08:01Z")

</div>

Such a feature is likely to come in the future - I believe AnkiDroid already implements this, and we’ll need it when migrating the editor to mobile platforms.

---

<div class="post-metadata">

**Author:** ![Kazue](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@Kazue](https://forums.ankiweb.net/u/Kazue)\
**Post date:** [January 18, 2025, 5:41pm UTC](https://forums.ankiweb.net/t/button-to-insert-html-at-selected-text/23922/7 "2025-01-18T17:41:29Z")

</div>

Yes, that’s why I’m asking. It’s already there in AnkiDroid and I was very surprised that I couldn’t find it neither in Desktop Anki nor as an addon. Happy to hear it’s likely going to be added in the future!
