MathJax Not Rendering Inside Without Newline After

Ethsim2
Wed, 23 Jul 2025 11:11:05 +0000
Support

Hi — this is a follow-up to my earlier post:

MathJax not working inside details sections Bug

it would be nice if we allow discourse math to work in hidden details panes aswell? [The image displays the iconic equation E=mc², with a dark background and presentation icons below. (Captioned by AI)] [The image displays a dark screen with a text editor toolbar and the equation E=mc² repeated, along with some code-like annotations. (Captioned by AI)]

I’ve identified that MathJax expressions inside blocks do not render unless a newline is inserted immediately after the tag.

Minimal reproduction:

This does not render:

Example
$$
x^2 + y^2 = z^2
$$


This does render:

Example

$$
x^2 + y^2 = z^2
$$


Notes:

This behavior is unintuitive and undocumented.

It affects both inline and block MathJax.

ChatGPT tells me it “Tested on Discourse 3.2.0beta3 with default settings”.

Could this be made more robust or documented somewhere for users relying on math formatting?

5 messaggi - 4 partecipanti