MathJax fails to render inline math when followed by curly apostrophe (U+2019) but works with straight apostrophe (U+0027)

Ethsim2
Wed, 23 Jul 2025 11:38:39 +0000
Support

I’m encountering a rendering issue with inline MathJax in Discourse when the math expression is followed by a curly apostrophe (U+2019), which is commonly substituted by smart quotes in some browsers or editors.

This renders correctly:

$\mathbb{R}^2$'s basis

This uses the straight ASCII apostrophe (U+0027).

\mathbb{R}^2's basis

This fails to render:

$\mathbb{R}^2$’s basis

$\mathbb{R}^2$’s basis

This uses the curly right single quote (U+2019), sometimes auto-inserted by mobile keyboards, rich text editors, or copy/paste from formatted sources.

Expected behavior:

Both versions should render the math properly. The character immediately following an inline math block shouldn’t affect MathJax parsing.

Why this matters:

This is hard to detect unless you’re comparing Unicode.

The curly apostrophe is visually indistinguishable from the straight one in most fonts.

A minor formatting difference like this shouldn’t silently break rendering.

Inconsistent behavior undermines the authoring experience for math-heavy posts.

4 messaggi - 2 partecipanti