# Rendering math inside polls

**URL:** https://meta.discourse.org/t/rendering-math-inside-polls/185009
**Category:** Feature
**Tags:** polls, pr-welcome, math
**Created:** [March 31, 2021, 6:37pm UTC](https://meta.discourse.org/t/rendering-math-inside-polls/185009 "2021-03-31T18:37:59Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![merry](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@merry](https://meta.discourse.org/u/merry)
#### Post date: [March 31, 2021, 6:37pm UTC](https://meta.discourse.org/t/rendering-math-inside-polls/185009/1 "2021-03-31T18:37:59Z")

</div>

Similar issue to [this post](https://meta.discourse.org/t/math-not-rendering-in-embedded-posts/176699).

Math does not render inside a poll.

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/1/d19a10bc386bbd64666741417fbf1a822e00351c.png)

It renders in the compose post screen but not in the poll itself:

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/6/e62145fec5685c707f5c3bce5977675dc9cb3ad3.png)

Inspect element reveals `<span class="math">` … `</span>`. Can someone point me in the right direction how to fix this please 🙂 ? (Assuming the solution is similar to the above-linked post)

---

<div class="post-metadata">

### Author: ![cocococosti](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cocococosti/32/231474_2.png) [@cocococosti](https://meta.discourse.org/u/cocococosti)
#### Post date: [April 18, 2021, 10:42pm UTC](https://meta.discourse.org/t/rendering-math-inside-polls/185009/2 "2021-04-18T22:42:18Z")

</div>

I couldn’t make this work either. Seems like a bug to me.

When adding math formulas to a poll they are rendered correctly in the preview

 ![Screenshot_2021-04-18 Testing math inside polls - Test - Constanza's Discourse](https://global.discourse-cdn.com/meta/original/3X/a/8/a847d630e615d5b243fee2d94ba83a99c43795ea.png)

But not in the post itself:

 ![Screenshot_2021-04-18 Testing math inside polls - Test - Constanza's Discourse(1)](https://global.discourse-cdn.com/meta/original/3X/a/2/a21e6cd12f6483760f707c58774e16e6c04c3014.png)

When inspecting the source code, I saw formulas are rendered in `<span class="math-container inline-math mathjax-math"> ... </span>` but in the polls, formulas are rendered in `<span class="math"> ... </span>`. If I test it in [safe mode](https://meta.discourse.org/t/53504?silent=true) (with plugins disabled) all formulas are rendered in `<span class="math"> ... </span>`. Which makes me think the math plugin doesn’t work with the poll plugin.

As an alternative, you could put your formulas outside the poll, and then reference them in the poll like so:

 ![Screenshot_2021-04-18 Testing math inside polls - Test - Constanza's Discourse(2)](https://global.discourse-cdn.com/meta/original/3X/3/7/3718b46de6d79efdd7048b46efb680a67f5f6261.png)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 13, 2022, 2:58am UTC](https://meta.discourse.org/t/rendering-math-inside-polls/185009/3 "2022-02-13T02:58:44Z")

</div>

I don’t know if math markup is supported inside polls @sam.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [February 14, 2022, 2:24am UTC](https://meta.discourse.org/t/rendering-math-inside-polls/185009/4 "2022-02-14T02:24:23Z")

</div>

Yeah I do not think we built support for it. I guess PR welcome to get this working.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [June 23, 2025, 7:43am UTC](https://meta.discourse.org/t/rendering-math-inside-polls/185009/5 "2025-06-23T07:43:42Z")

</div>

Will be fixed in:

> [@MathJax not working in poll options](https://meta.discourse.org/t/mathjax-not-working-in-poll-options/370632/6):
>
> I’m afraid you won’t learn much from the change, it’s a little bit of a dark magic change. [https://github.com/discourse/discourse-math/commit/e7ef2ec223d661954b870216d6da61bda8a677c5](https://github.com/discourse/discourse-math/commit/e7ef2ec223d661954b870216d6da61bda8a677c5) Poll is an old plugin and it’s probably doing something incorrect which forces me to do this here. I saw the issue but honestly didn’t dig the root cause as this interaction discourse-math/poll is quite a niche subject in our codebase and couldn’t justify spending days on it.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [June 26, 2025, 7:44am UTC](https://meta.discourse.org/t/rendering-math-inside-polls/185009/6 "2025-06-26T07:44:03Z")

</div>

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