# \[Bug?\] Handle html entities in mathjax

**URL:** <https://forums.ankiweb.net/t/bug-handle-html-entities-in-mathjax/27789>\
**Category:** Suggestions\
**Created:** [February 23, 2023, 3:29am UTC](https://forums.ankiweb.net/t/bug-handle-html-entities-in-mathjax/27789 "2023-02-23T03:29:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arkan](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/arkan/32/3216_2.png) [@Arkan](https://forums.ankiweb.net/u/Arkan)\
**Post date:** [February 23, 2023, 3:29am UTC](https://forums.ankiweb.net/t/bug-handle-html-entities-in-mathjax/27789/1 "2023-02-23T03:29:03Z")

</div>

Oftentimes, when I would copy/paste latex code, html entities like ‘&nbsp;’ gets copied along the way (or just selecting text in the WYSIWYG we may not realize a “no break space” or other entity is being selected)  
and so, when converting to mathjax with the icon, or the shortcut “ctrl-m then m”, the math doesn’t render properly:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/0/04515fe7169757180ce4033230e34cd1a3531812.png)

The issue only arise when editing the fields of a card, either in the browser, or adding cards; preview and review mode will render fine, since mathjax actually handle this corner case. My guess is that the new Qt UI (pretty awesome by the way) is not handling that corner case.

---

<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 24, 2023, 10:59am UTC](https://forums.ankiweb.net/t/bug-handle-html-entities-in-mathjax/27789/2 "2023-02-24T10:59:52Z")

</div>

Does the issue exist in 2.1.60?

---

<div class="post-metadata">

**Author:** ![Arkan](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/arkan/32/3216_2.png) [@Arkan](https://forums.ankiweb.net/u/Arkan)\
**Post date:** [February 24, 2023, 12:24pm UTC](https://forums.ankiweb.net/t/bug-handle-html-entities-in-mathjax/27789/3 "2023-02-24T12:24:07Z")

</div>

Yes:  
 ![mathjax_buganki260](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/e/ed5c3c0c02218d024935eeaae572992240f85713.gif)

---

<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 27, 2023, 9:30am UTC](https://forums.ankiweb.net/t/bug-handle-html-entities-in-mathjax/27789/4 "2023-02-27T09:30:03Z")

</div>

Thank you, I’ve logged this on [MathJax doesn't handle non-breaking spaces and other entities · Issue #2402 · ankitects/anki · GitHub](https://github.com/ankitects/anki/issues/2402)
